-1
我正在编写一个从文档中提取某些页面的功能,以便它可以用作证明。我使用了一个开关盒,如果它是真的,会输出一些页面。在第三种情况下,我想提取文档的前两页,即第23页和第24页以及最后两页。这是我无法解决的。我可以只使用this.extractPages方法,还是必须使用insertPages方法。如果我需要insertPages方法,我该如何使用它。代码位于可信功能中。在Acrobat DC中提取一些页面并保存该文件
switch (true){
case this.numPages == 1:
this.extractPages(0,0, newPath);
app.alert("A one paged proof has been created",3)
break;
case ((this.numPages > 1) && (this.numPages < 9)):
this.extractPages(0,1, newPath);
app.alert("A two paged proof has been created",3)
break;
(PROBLEM IS HERE)
case ((this.numPages > 9) && (this.numPages < 49)):
this.extractPages(0,1, newPath);
app.alert("A proof has been created",3)
break;
default:
app.alert("No proof has been created",3)
break;
非常感谢您的信息。你是对的,我会尽力删除我不需要的页面然后保存。我会试着找出使用哪种方法。谢谢! – Heresh
使用this.deletePages(nStart,nEnd),但从后面开始,这样当删除不需要的部分时,您不需要重新计算页码。记得页码是从零开始的。然后将this.saveAs()与新文件的路径一起使用。 – joelgeraci
this.deletePages(this.numPages-2,this.numPages/2);它不工作的原因im试图从后面工作 – Heresh