Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/369.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Javascript从Acrobat Reader中的PDF提取特定页面_Javascript_Pdf_Printing_Adobe_Acrobat - Fatal编程技术网

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

使用Javascript从Acrobat Reader中的PDF提取特定页面,javascript,pdf,printing,adobe,acrobat,Javascript,Pdf,Printing,Adobe,Acrobat,我有一个由多个页面组成的PDF,用户可以选择打印。用户选择使用第一页上的一组勾选框(即theMRI、THEEG等) 有一个打印按钮,然后将选中的页面发送到最近的打印机。我想知道是否有可能修改这个脚本,将这些相同的页面提取到用户计算机上本地保存的PDF 可能吗 var theMRI = this.getField("MRI").value; var theEEG = this.getField("EEG").value; var theMGL = this.getField("MGL").valu

我有一个由多个页面组成的PDF,用户可以选择打印。用户选择使用第一页上的一组勾选框(即theMRI、THEEG等)

有一个打印按钮,然后将选中的页面发送到最近的打印机。我想知道是否有可能修改这个脚本,将这些相同的页面提取到用户计算机上本地保存的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});

使用AdobeReader?不可以。Adobe Reader无法修改PDF的页面或页面内容。然而。如果用户有Adobe Acrobat Standard或Pro,JavaScript可以使用下面的代码将页面提取到新的PDF。PDF页码以零为基础,因此第一页为0。第三个参数是提取页面的文件名

 this.extractPages(startPageNum, endPageNum, "extractedPages.pdf")