Print Page | Close Window

Extracting Page Numbers as a Variable

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2650
Printed Date: 04 Apr 26 at 8:04PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Extracting Page Numbers as a Variable
Posted By: datagraphic
Subject: Extracting Page Numbers as a Variable
Date Posted: 22 May 13 at 10:38AM
hi,
        I need to extract the page numbers contained in a PDF.

 ie If there are 4 pages in the PDF i need to extract the number 4 and use it for calcualtions on another piece of software in a continuous automated process.

Is this possible?

DG.  :-)



Replies:
Posted By: Ingo
Date Posted: 22 May 13 at 12:18PM
Hi DG!
 
Yes. It's possible.
What's the next question?    :)
Use one of the first step codes.
Put in a LoadFromFile...
...and then use function PageCount.
 
Cheers and welcome here,
Ingo
 


Posted By: AndrewC
Date Posted: 23 May 13 at 2:48AM
DG,

The second approach usig the DA functions will be the fastest as it doesn't need to load the entire file into memory.

  QP.LoadFromFile("4pages.pdf", "");
  int pageCount = QP.PageCount();
  QP.RemoveDocument(QP.SelectedDocument());

or

  int fh = QP.DAOpenFile("4pages.pdf", "");
  int pageCount = QP.DAGetPageCount(fh);
  QP.DACloseFile(fh);

Andrew.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk