I am sure this is posted somewhere but I just cannot seem to find it in this forum. Can someone post the link to the code that lets me call a specific page extraction? I am trying to implement (currently unsuccessfully):
1) count the number of pages within the PDF
2) extract a specific page for single page display
3) allow specific page edits for the single page displayed
Case scenario: user references a 10 page PDF. they choose page #3 and make some changes, then click on page #7 to look at it and then close the PDF with saved changes.
Challenging part: I do not want the full PDF displayed, just stored within a xpdf object that can be referenced.
How can I do this?
Many thanks!
-Eric
extract specific pages from PDF Document SOLVED
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
- Ivan - Tracker Software
- Site Admin
- Posts: 3550
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
Re: extract specific pages from PDF Document SOLVED
I guess you already have a PDF document opened. Let's say it will be
it is much simpler in C# or C++ with non-raw-only import:
HTH
Code: Select all
IPXV_Document* pVDoc;
to get the number of pages in the document you can use the following code:1) count the number of pages within the PDF
Code: Select all
CComPtr<IPXV_Document> pRDoc;
pVDoc->get_CoreDoc(&pRDoc);
CComPtr<IPXC_Pages> pages;
pRDoc->get_Pages(&pages);
UINT_T numPages = 0;
pages->get_Count(&numPages);
Code: Select all
auto numPages = pVDoc->CoreDoc->Pages->Count;
To extract pages into a new document, you have to use Extract Pages operation. There is a small sample of how to use it.2) extract a specific page for single page display
It depends on how you display the PDF. If you use IPXV_Control (actually, in this case, there is a simple way to get the number of pages -- just use a corresponding property of the IPXV_Control), you can set layout mode "Single Page" and control (for example via EnableEventListening) switch pages.3) allow specific page edits for the single page displayed
HTH
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.