Solved

Lotusscript and PDF Page Count

Posted on 2013-05-21
7
631 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
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

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 article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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