打开adode pdf并通过添加文本框来编辑页面 [英] Open adode pdf and edit a page by adding a text box

查看:179
本文介绍了打开adode pdf并通过添加文本框来编辑页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用Adobe进行vba编码非常陌生,无法使用任何代码。我首先需要打开文档中的pdf文件(使用Adobe Acrobat),然后通过添加一个或多个文本框来编辑第5页。我想知道这是否可行,是否有代码可以做到这一点。我有Adobe Acrobat XI Standard,它允许我手动编辑pdf并在需要的地方创建文本框。
任何帮助将不胜感激。

I'm quite new to vba coding with adobe and can't get any code to work. I first need to open a pdf located in my documents (with adobe acrobat) and then edit the 5th page by adding a textbox/or a number of text boxes. I was wondering if this was possible and if there was code to do this. I have Adobe Acrobat XI Standard, which allows me to edit pdfs manually and create text boxes where needed. Any help would be much appreciated.

谢谢

推荐答案

<在仔细阅读有关OLE自动化和API参考的adobes文档之后,我发现您实际上可以使用acrobat在VBA中很好地编码。享受并适应您的需求。这是Adobe的API参考的链接: http ://www.adobe.com/content/dam/Adobe/zh-CN/devnet/acrobat/pdfs/iac_api_reference.pdf

Sub RMS_pdf()

 Application.DisplayAlerts = False
 Application.CutCopyMode = False


Set wb1 = Workbooks.Open(Filename:="\\ldnfortunenet\fortunenetdocuments\William Hadman\Suitability\RMS\RMS Product Governance Reports\" & LongNewDate & "\RMS Product Governance Report.xlsm", UpdateLinks:=True)

Set ws1 = wb1.Sheets("Performance & Volatility")
    Set ws2 = wb1.Sheets("Asset Allocation")
    Set ws3 = wb1.Sheets("Detailed Contribution")


OpenPath = "\\ldnfortunenet\fortunenetdocuments\William Hadman\Aushir Shah\RMS Product Governance Reports\RMS Product Governance Report - 2016-10-31 -  CDF Direct Diversified Income.pdf"
SavePath = "\\ldnfortunenet\fortunenetdocuments\William Hadman\Aushir Shah\RMS Product Governance Reports\RMS Product Governance Report - 2016-10-31 -  CDF Direct Diversified Income v2.pdf"
'initialize the Acrobat interface
Set AcroApp = CreateObject("AcroExch.App")
Set gpdDoc = CreateObject("AcroExch.PDDoc")
'open the file
If gpdDoc.Open(OpenPath) Then
Set jso = gpdDoc.GetJSObject
End If
'get at the jso
If Not jso Is Nothing Then
If gpdDoc.Open(dest) Then
Set jso = gpdDoc.GetJSObject
End If

LastPage = gpdDoc.GetNumPages - 1

Set Box1 = jso.AddField("Performance Comment - " & StrategyName(4), "text",            LastPage, Array(583.8, 706.32, 224.7, 583.2))
Box1.TextFont = "Helvetica"
Box1.TextSize = 8

Else
End If
If gpdDoc.Save(PDSaveFull, SavePath) = False Then
MsgBox "Unable to save image"
Else
End If

这篇关于打开adode pdf并通过添加文本框来编辑页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆