简体   繁体   English

使用 Excel VBA 宏实现 Nuance Power PDF 自动化

[英]Nuance Power PDF Automation using Excel VBA Macro

I am trying to automatically control Nuance Power PDF to merge PDF files and create table of contents and bookmarks using Excel VBA Macro.我正在尝试自动控制 Nuance Power PDF 以合并 PDF 文件并使用 Excel VBA 宏创建目录和书签。

I found some information on how to accomplish this task using Adobe's Acrobat, but I haven't found anything regarding Nuance Power PDF.我找到了一些有关如何使用 Adob​​e 的 Acrobat 完成此任务的信息,但我没有找到有关 Nuance Power PDF 的任何信息。

So my question is: which reference do I have to set in VBA and is there some sort of help file containing the common methods and objects to address Power PDF over VBA?所以我的问题是:我必须在 VBA 中设置哪个参考,是否有某种帮助文件包含通过 VBA 解决 Power PDF 的常用方法和对象?

The file which you seek is called "Power PDF 2 Automation interface.doc" by Bence.Balazs@nuance.com您查找的文件由 Bence.Balazs@nuance.com 称为“Power PDF 2 Automation interface.doc”

Add the following reference PDFPlus C:\\Program Files (x86)\\Nuance\\Power PDF\\bin\\GPlusCore.dll添加以下引用 PDFPlus C:\\Program Files (x86)\\Nuance\\Power PDF\\bin\\GPlusCore.dll

Here is example code from the file for insert a page into a pdf from another pdf.这是文件中的示例代码,用于将页面从另一个 pdf 插入到 pdf 中。

Dim PDFApp As PDFPlus.App
Dim ddDocTarget As PDFPlus.ddDoc
Dim ddDocSource As PDFPlus.ddDoc

Set PDFApp = CreateObject("NuancePDF.App")
Set ddDocTarget = CreateObject("NuancePDF.DDDoc")

If ddDocTarget.Open("mydoc.pdf") = False Then
    PDFApp.Exit
    Exit Sub
End If

Set ddDocSource = CreateObject("NuancePDF.DDDoc")

If ddDocSource.Open("pdfpages.pdf") = False Then
    ddDocTarget.Close
    PDFApp.Exit
    Exit Sub
End If

If ddDocTarget.InsertPages(1, ddDocSource, 0, 2, False) = False Then
    ddDocSource.Close
    ddDocTarget.Close
    PDFApp.Exit
    Exit Sub
End If

If ddDocTarget.Save(DDSaveFull, " mydoc.pdf") = False Then
    'Saving the file failed
End If

ddDocSource.Close
ddDocTarget.Close
PDFApp.Exit

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

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