Nuance Power使用Excel VBA宏的PDF自动化

时间:2016-09-01 11:07:21

标签: excel vba excel-vba pdf

我正在尝试自动控制Nuance Power PDF以合并PDF文件并使用Excel VBA宏创建目录和书签。

我找到了一些关于如何使用Adobe Acrobat完成此任务的信息,但我还没有找到任何关于Nuance Power PDF的信息。

所以我的问题是:我必须在VBA中设置哪个参考,是否有某种帮助文件包含通过VBA解决Power PDF的常用方法和对象?

1 个答案:

答案 0 :(得分:0)

您寻找的文件被Bence.Balazs@nuance.com称为“Power PDF 2 Automation interface.doc”

添加以下参考 PDFPlus C:\ Program Files(x86)\ Nuance \ Power PDF \ bin \ GPlusCore.dll

以下是文件中的示例代码,用于将页面从另一个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