Solved

Lotusscript and PDF Page Count

Posted on 2013-05-21
7
639 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 54

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 54

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Closing Comment

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

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 54

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

634 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