How can I retrieve the list of objects in a PDF file?

This is a read only forum. It contains the most frequently asked questions about Amyuni products and licensing.
Post Reply
Dany
Amyuni Team
Posts: 113
Joined: Wed Sep 11 2002
Location: Montreal.
Contact:

How can I retrieve the list of objects in a PDF file?

Post by Dany »

Here is a VB code that enables you to retrieve the list of objects in a pdf file:
Private Sub cmdLoop_Click()
Dim obj As Variant
Dim objarray As Variant

PDF1.SetLicenseKey LicenseTo, ActivationCode
PDF1.Open "c:\temp\fourPage.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") = 5 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
Post Reply