Editing Form Fields in an existing document

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

Editing Form Fields in an existing document

Post by CodespringsMike »

Hello. I am trying to open an existing PDF document, Enter text into a particular form field, then save to a different name. I have found documentation on the ObjectAttribute function, but my question is How do I get the existing Form Field object without using Coordinates or creating a new one? Is there a way to get this object by its' name?

I am using the evaluation version of PDF Creator - Developer.

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

Post by Joan »

Hello,

Please find here a snipet of code that retreive from a pdf file all the objects of type Field and return their attributes:

-----------------------------------------------------------------------------------

Private Sub cmdLoop_Click()

Dim obj As Variant

Dim objarray As Variant


PDF1.SetLicenseKey LicenseTo, ActivationCode

PDF1.Open "c:\temp\test.pdf", ""


'get all array of objects in Page[1]

objarray = PDF1.ObjectAttribute("Pages[1]", "Objects")


'Gets all the object type number 5 and retrieve information about them

For Each obj In objarray

DoEvents

If obj.Attribute("ObjectType") = 6 Then ' returns the object reference

MsgBox ("Right: " & obj.Attribute("Right") & vbNewLine & _

"Left: " & obj.Attribute("Left") & vbNewLine & _

"Bottom: " & obj.Attribute("Bottom") & vbNewLine & _

"Top: " & obj.Attribute("Top") & vbNewLine & _

"TextFont: " & obj.Attribute("TextFont") & _

"Name: " & obj.Attribute("Name"))

End If

Next

End Sub

--------------------------------------------------------------------

You can find more information about objects type and attribute on pages 25 - 26 of the Developers' manual "Amyuni PDF Creator.pdf"

Regards.
CodespringsMike
Posts: 8
Joined: Tue Jan 20 2004

Thank You!!

Post by CodespringsMike »

That does it!! Thanks. :D
Post Reply