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.

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

Postby CodespringsMike on Tue Jan 20 2004

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!
CodespringsMike
 
Posts: 8
Joined: Tue Jan 20 2004

Postby Joan on Wed Jan 21 2004

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.
Joan
Amyuni Team
 
Posts: 2799
Joined: Wed Sep 11 2002

Thank You.

Postby CodespringsMike on Wed Jan 21 2004

This works great. Sorry to be such a newbie!! :D
CodespringsMike
 
Posts: 8
Joined: Tue Jan 20 2004


Return to Visual Basic Community

Who is online

Users browsing this forum: No registered users and 2 guests