Solved

Lotusscript and PDF Page Count

Posted on 2013-05-21
7
623 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 51

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 51

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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Closing Comment

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

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 51

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

757 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

19 Experts available now in Live!

Get 1:1 Help Now