我正在使用PDFCreator将多个文件合并为一个PDF文件。 的代码看起来是这样的:PDFCreator将多个pdf文件合并为一个
dim pdfJob as new PDFCreator.clsPDFCreator
with pdfJob
.cOption("UseAutosave")=1
.cOption("UseAutosaveDirectory")=1
.cOption("AutosaveDirectory")=sPDFPath
.cOption("AutosaveFilename")="combine.pdf"
.cOption("Autosaveformat")=0
.cClearCache
end with
pdfJob.cPrinterStop = true
pdfJob.cPrintFile("c:\1.pdf") 'pdf-reader pops up and freezes until it is closed
sleep(2000)
pdfJob.cPrintFile("c:\2.pdf") 'pdf-reader pops up and freezes until it is closed
sleep(2000)
pdfJob.cPrintFile("c:\3.pdf") 'pdf-reader pops up and freezes until it is closed
sleep(2000)
pdfJob.cCombineAll
pdfJob.cPrinterStop = false
此代码将很好地工作,如果我打印.TXT,.DOC,但是当涉及到PDF,它将停止在每个打印,直到我们关闭PDF阅读器应用程序(如adobe pdf阅读器,foxit阅读器)(在pdfJob.cPrintfile行上)手动(即在上面的例子中,我们将需要关闭PDF阅读器三次,然后才会尝试合并pdf)。
我可以问有没有办法绕过这个手动关闭步骤,因为我会自动化该过程。
注意:如果我们设置pdfJob.cPrinterStop为假,应用程序窗口将仍然弹出,但它不会挂(只是它不会结合PDF文件)
非常感谢