Can someone post an example of Opening, editing and saving?

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
CodespringsMike
Posts: 8
Joined: Tue Jan 20 2004

Can someone post an example of Opening, editing and saving?

Post by CodespringsMike »

Hi. Can someone put up an example of Opening an existing PDF document (Created in Adobe Acrobat), Filling in a form field called txtField1, and then saving the document?

I am currently evaluating the software and need this kind of functionality.

Thank You!
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Please find here a sample code on selecting a Field and changing its value at run mode.

Private Sub cmdDeleteObject_Click()
Dim obj As Variant
Dim objarray As Variant

'New for version 1.50
PDF1.SetLicenseKey LicenseTo, ActivationCode
PDF1.Open "c:\temp\test.pdf", ""

'Put report into RunState
'PDF1.ReportState = acReportStateRun

'get an array of all objects in Page[1]
objarray = PDF1.ObjectAttribute("Pages[1]", "Objects")


'Find and edit an object named "txtField1"
For Each obj In objarray
If obj.Attribute("Name") = "txtField1" Then

obj.Attribute ("Value") = "New Value"
'This fucntion enables the changes
PDF1.DoCommandTool (acCommandToolRunDocument)
End If
Next
'Save file
PDF1.Save "c:\temp\NewTest.pdf", 0
End Sub


Hope this helps.
CodespringsMike
Posts: 8
Joined: Tue Jan 20 2004

Thank You.

Post by CodespringsMike »

This works great. Sorry to be such a newbie!! :D
Post Reply