Solved

Lotusscript and PDF Page Count

Posted on 2013-05-21
7
628 Views
Last Modified: 2013-12-18
I was curious if anyone had some sample code or could point me in the right direction.

Is there a way to determine how many pages a saved PDF file has ?
0
Comment
Question by:nbtnotes
  • 4
  • 3
7 Comments
 
LVL 52

Expert Comment

by:Joe Winograd, EE MVE
ID: 39186087
I know nothing about LotusScript, but like any scripting language, I'm sure it can call a command line EXE, in which case Xpdf's [pdfinfo.exe] will do it for you:
http://www.foolabs.com/xpdf/download.html

The binary library has seven stand-alone executables, but all you need is [pdfinfo.exe], which creates a text file like this:

Producer:       doPDF Ver 7.2 Build 359
CreationDate:   02/04/13 18:47:01
Tagged:         no
Form:           none
Pages:          3
Encrypted:      no
Page size:      612 x 792 pts (letter)
File size:      119645 bytes
Optimized:      no
PDF version:    1.5

The "Pages:" line is what you want.

Another one that also works is PDF Labs' PDF Toolkit:
http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/

It produces a text file like this:

InfoBegin
InfoKey: Producer
InfoValue: doPDF Ver 7.2 Build 359
InfoBegin
InfoKey: CreationDate
InfoValue: D:20130204184701-06'00'
NumberOfPages: 3

The parameter you want with PDFtk to create the above file is "dump_data".

I have used both [pdfinfo.exe] and [pdftk.exe] in many scripts...they work a charm! Regards, Joe
0
 

Accepted Solution

by:
nbtnotes earned 0 total points
ID: 39245533
I purchased Adobe Acrobat Pro XI and connected via the SDK. I was able to access the page page count via GetNumPages.
0
 
LVL 52

Expert Comment

by:Joe Winograd, EE MVE
ID: 39245622
To help other EE members who are looking for a similar solution and don't want to purchase the Acrobat SDK, can you let us know if the two free solutions that I posted also work for you? Thanks, Joe
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Closing Comment

by:nbtnotes
ID: 39255623
Identified the need for Acrobat and found the appropriate method needed for the task.
0
 
LVL 52

Expert Comment

by:Joe Winograd, EE MVE
ID: 39256180
pdfinfo (answer not mine...was acrobat)
0
 

Author Comment

by:nbtnotes
ID: 39256195
I didn't try the 2 free solutions. I believe the Reader SDK might work, however I purchased mostly for using other features Pro offers.
0
 
LVL 52

Expert Comment

by:Joe Winograd, EE MVE
ID: 39256892
Oops...the "pdfinfo (answer not mine...was acrobat)" comment was supposed to be a private note in my Personal KnowledgeBase...I like to keep track of what I recommended (in this case, pdfinfo) and what the accepted answer was, when it wasn't mine (in this case, Acrobat). Sorry about that...didn't mean to post it here. But thanks for your last comment...very helpful! Regards, Joe
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now