在Acrobat Reader中使用Javascript从PDF中提取特定的页面。

问题描述 投票:0回答:1

我有一个由多页组成的PDF,用户可以选择打印。用户在第一页使用一组勾选框进行选择(即MRI、EEG等)。

有一个PRINT按钮,然后将被勾选的页面发送到最近的打印机。我想知道是否有可能修改这个脚本来提取这些相同的页面,而不是保存在用户电脑上的PDF。

这可能吗?

var theMRI = this.getField("MRI").value;
var theEEG = this.getField("EEG").value;
var theMGL = this.getField("MGL").value;
var theCyto = this.getField("Cytogen").value;
var theMito = this.getField("Mitogen").value;
var theOutpt = this.getField("Outpt_Lab").value;

if (theMRI != "Off") this.print({bUI: false, bSilent: true, bShrinkToFit: true, nStart: 1, nEnd: 3});
if (theEEG != "Off") this.print({bUI: false, bSilent: true, bShrinkToFit: true, nStart: 4, nEnd: 4});
if (theMGL != "Off") this.print({bUI: false, bSilent: true, bShrinkToFit: true, nStart: 5, nEnd: 5});
if (theCyto != "Off") this.print({bUI: false, bSilent: true, bShrinkToFit: true, nStart: 6, nEnd: 7});
if (theMito != "Off") this.print({bUI: false, bSilent: true, bShrinkToFit: true, nStart: 8, nEnd: 9});
if (theOutpt != "Off") this.print({bUI: false, bSilent: true, bShrinkToFit: true, nStart: 10});
javascript pdf printing adobe acrobat
1个回答
0
投票

使用Adobe Reader?不,Adobe Reader不能修改PDF的页面或页面内容。但是,如果用户有Adobe Acrobat Standard或Adobe Acrobat Reader,则可以修改PDF的页面或页面内容。如果用户有Adobe Acrobat Standard或Pro,一个JavaScript可以提取页面到一个新的PDF使用类似下面的代码。PDF页码是基于零的,所以第一页是0。第三个参数是提取页面的文件名。

 this.extractPages(startPageNum, endPageNum, "extractedPages.pdf")
© www.soinside.com 2019 - 2024. All rights reserved.