繁体   English   中英

在 Acrobat Pro 中使用 javascript 从 PDF 中提取页面

[英]Extract pages from PDF with javascript in Acrobat Pro

我正在尝试创建一个脚本,该脚本将从pdf中提取所有页面,并从Z4375BA4191210EE004E1D937494D09Z的Z4375BA4191210EE004EN11 ENPORY IT11 for 504.page for 5047.pdfff中命名,并将其命名.pdf、5049.pdf 等。但是我的脚本没有做任何事情。

var filename = 0;
for (var i = 0; i < this.numpages; i++)
this.extractpages

({
nStart: i,
cpath: filename + i + ".pdf"

});

原始链接: https : //forums.adobe.com/thread/969135

该解决方案基于Adobe论坛的答案:

/* Extract Pages to Folder */

var re = /.*\/|\.pdf$/ig;

var filename = this.path.replace(re,"");
var lastPage=this.numPages-1;
{
    for ( var i = 0;  i < this.numPages; i++ ) 
    this.extractPages
     ({
        nStart: i,
        nEnd: lastPage,
        cPath : filename + "_page_" + (i+1) + ".pdf"
    });
};

这对我有用,有必要连续提取 2 页:

 /* Extract Pages to Folder */ var re = /.*\/|\.pdf$/ig; var filename = this.path.replace(re,""); var lastPage=this.numPages-1; { for ( var i = 0; i < this.numPages; i = i + 2 ) this.extractPages ({ nStart: i, nEnd: i + 1, cPath: filename + "_page_" + (i+1) + ".pdf" }); };

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM