I'm having a problem reading in objects which were created using PDF Creator. I tried creating a sample of every kind of object and saving the PDF, then reading it in using VB. I'm using the demo version of PDFCreator.
This is the code snippet to read it in:
Code: Select all
Set objamyuni = CreateObject("PDFCreactiveX.PDFCreactiveX")
' Open Amyuni template for writing
With objamyuni
.SetLicenseKey LicenseTo, ActivationCode
.ReportState = acReportStateDesign
.Open "c:\docmaker\templates\AST-GLCert-AST.pdf", ""
End With
' Read all objects and output their name
Dim objArray As Variant
Dim obj As Variant
objArray = objamyuni.ObjectAttribute("Pages[1]", "Objects")
For Each obj In objArray
Call DebugTextBox("object in array")
Next
If I add this code snipped to create a new object on the same PDF "on the fly", it does read that one in.
Code: Select all
' Create a dummy text object
With objamyuni
.CreateObject acObjectTypeText, "Frame 1"
.ObjectAttribute("Frame 1", "Left") = 200
.ObjectAttribute("Frame 1", "Top") = 200
.ObjectAttribute("Frame 1", "Right") = 600
.ObjectAttribute("Frame 1", "Bottom") = 400
End With
How should I be creating/saving the objects on the PDF in order for them to be visible to VB? Or should I be reading them in some different way?