Total Document Length

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
ASRoden
Posts: 36
Joined: Thu Jun 15 2006
Location: Auburn, NY USA
Contact:

Total Document Length

Post by ASRoden »

Hi is there a way to determine the total length of the document?
I am trying to create my own adobe like vertical scroll bar so I can scroll to a particular page.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

You can determin the number of pages in the document and if you know the length of eah page you calculate the lenght of the document.

I believe that what you are trying to do is going to be added to version 3.0 of the PDF Creator, for confirmation please contact support@amyuni.com

Hope this helps
ASRoden
Posts: 36
Joined: Thu Jun 15 2006
Location: Auburn, NY USA
Contact:

Post by ASRoden »

I could get the length of a page and multiply by the number of pages, but in general each page could have it's own length no? I tried loading page by page in order to add up all the correct individual page lengths but was unsuccessful in getting this to work.

Any other ideas would be appreciated.

Do you have a release date for the next update?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

In this case, the only way to do it is to loop throught the pages and add the length of each one to get the total ength at the end.

We expect our new version to be ready end of January
ASRoden
Posts: 36
Joined: Thu Jun 15 2006
Location: Auburn, NY USA
Contact:

Post by ASRoden »

do you have an example of doing this?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Here is a VB sample on looping throught the pages of a pdf file and adding the length of each page.

This sample uses an instance of the PDF Creatror added to the VB form and called PDFCreactiveX1.

Code: Select all

Private Sub Command6_Click()

Dim lLength, ltotalLength As Long
Dim i As Integer

PDFCreactiveX1.Open "C:\Temp\test3.pdf", ""

For i = 1 To PDFCreactiveX1.PageCount
    lLength = PDFCreactiveX1.ObjectAttribute("Pages[1]", "Length")
    ltotalLength = ltotalLength + lLength
Next

MsgBox ltotalLength

End Sub
Post Reply