Hi,
In the application which i'm developing I want to find out if a particular Text object exists in a PDF document and if the Text object is there then change the color of the text and if the Text object is not found then create the Text object.
i'm using the following code.
Dim PDF1 As New ACPDFCREACTIVEX.PDFCreactiveX
Dim objDummy as object
With PDF1
.SetLicenseKey LICENSEE, LICENSECODE
.Open App.Path & "\Testfileafterinsertingpages.pdf", ""
Set objDummy = .GetObjectByName("Text3")
....................
The GetObjectByName method works perfectly when the object "Text3" is there in the .pdf file. But if the object is not there then its throwing a runtime error. In my appplication its is necessary that i search for the object before i make a change.
Please tell me where i'm going wrong?.
Is there a better way to find an object?.
Thanks and Regards
Shaun
Doubt regarding GetObjectByName Method
Hello,
As you set GetObjectbyName works properly if the object exists, if it doesn't how could it find it? it is normal than not to find the object.
If text3 doesn't exist in the PDF document than it can't be retreived, what you can do in this case is search for a specific text that you know existing in the document and not for the text object.
As you set GetObjectbyName works properly if the object exists, if it doesn't how could it find it? it is normal than not to find the object.
If text3 doesn't exist in the PDF document than it can't be retreived, what you can do in this case is search for a specific text that you know existing in the document and not for the text object.
Hi Joan,
I understand what you are saying. But what i want to do is in the opened PDF file, i have to check if an object exists or not. As you said if its there it can be retrieved. But my question is how to check if the object is there or not. I dont think i can check for the text(the contents). Because the contents of the Text Object is coming through a user entry.
Hope you are clear with this.
Shaun
I understand what you are saying. But what i want to do is in the opened PDF file, i have to check if an object exists or not. As you said if its there it can be retrieved. But my question is how to check if the object is there or not. I dont think i can check for the text(the contents). Because the contents of the Text Object is coming through a user entry.
Hope you are clear with this.
Shaun