Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Lotusscript and PDF Page Count

Posted on 2013-05-21
7
Medium Priority
?
651 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 56

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
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 56

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Closing Comment

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

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
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 56

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

773 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