Extract page form one PDF and put it in another

This Forum is for the use of End Users requiring help and assistance for Tracker Software's PDF-Tools Version 4

Moderators: Tracker Support, TrackerSupp-Daniel, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Tracker Supp-Stefan

Post Reply
johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

Extract page form one PDF and put it in another

Post by johnr@etakeoff.com » Fri Apr 17, 2015 2:16 pm

How can I extract a single page from a multi-page PDF file and create a separate PDF file containing just that page?

I see PXC_NewDocument() to create the destination document. I see PXC_GetPage() to get the page from the source document. But I don't see how to get the source page into the destination document. PXC_AddPage() and PXC_InsertPage seem to create new, empty pages. Is there some function I missed to copy the contents of one page into another?

Thanks.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13376
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Extract page form one PDF and put it in another

Post by Tracker Supp-Stefan » Fri Apr 17, 2015 3:54 pm

Hello John,

The PXC_ methods are for the creation of new files from scratch and PCXp_ are for working with existing files.
As you already have the PDF - maybe PXCp_InsertPagesTo will work better.

Regards,
Stefan

johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

Re: Extract page form one PDF and put it in another

Post by johnr@etakeoff.com » Fri Apr 17, 2015 4:32 pm

So I would use PXC_NewDocument to create the empty destination document
Then use PXCp_InsertPagesTo() to copy pages from the source to the destination
Then use PXC_WriteDocumentA() to save the destination document to a file
Is that right?

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13376
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Extract page form one PDF and put it in another

Post by Tracker Supp-Stefan » Fri Apr 17, 2015 4:58 pm

Hi John,

There is a code snippet sample at the bottom of the page I linked in my previous post - take a look at it. It's doing exactly what you need: Copy the first page of an existing document twice to a new one.

Regards,
Stefan

johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

Re: Extract page form one PDF and put it in another

Post by johnr@etakeoff.com » Fri Apr 17, 2015 8:39 pm

Works great.
Thanks for the help.

User avatar
Patrick-Tracker Supp
Site Admin
Posts: 1668
Joined: Thu Mar 27, 2014 6:14 pm
Location: Vancouver Island
Contact:

Re: Extract page form one PDF and put it in another

Post by Patrick-Tracker Supp » Fri Apr 17, 2015 8:43 pm

We are always happy to help. Stefan is off now so I will forward your thanks on to him.

Have a great weekend!
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Cheers,

Patrick Charest
Tracker Support North America

Post Reply