Problem with total number of pages in a document

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
shaun
Posts: 16
Joined: Mon Jul 17 2006
Contact:

Problem with total number of pages in a document

Post by shaun »

Hi,

I'm using PDF creator 2.0 which comes with the demo suite.

First i open a file which is having 12 pages. The command i use is

With CreatorRef
.SetLicenseKey LICENSEE, LICENSECODE
.Open "C:\Temp\Test.pdf", ""
then on page 1 i create a text object called "text1".
.CurrentPage = 1
.CreateObject acObjectTypeText, "text1"

and i'm adding a few attributes also. Finally i save the file as a new one using the following code

.Save "C:\Temp\" & "Testobjects.pdf", 0

Then in another procedure i open the saved file(Testobjects.pdf). here also i use the open method to open the file.

But to my suprise when i check the number of pages(pagecount) using .pagecount property i get count as "1". how did the 12 pages document(the original one) turned 1 page when i saved it as a new file. When i open the saved file(the new one) in a Adobe Acrobat i get to see all the twelve pages.

Now i tried another way to save the original file using the following method

.Save "C:\Temp\" & "Testobjects2.pdf", 1

the file gets saved and then when opened the same file and tried the .pagecount property it showed "12" which is correct. But when i
use the following code
Set obj = .GetObjectByName("text1") i got the following runtime error.

Runtime error (-2147467259 Method "GetObjectByName" of object ‘IPDFCreativeX’ failed.

Why is this error coming?.

What i want to acheive is first open a file and then save it after adding some object/objects to it. Then later open the same file and then locate the object which i added.

I might have to use the .pagecount property also.

Hope you are clear about the issue.

Thanks and Regards
Vipin
Post Reply