Page 1 of 1

Extract page form one PDF and put it in another

Posted: Fri Apr 17, 2015 2:16 pm
by johnr@etakeoff.com
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.

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

Posted: Fri Apr 17, 2015 3:54 pm
by Tracker Supp-Stefan
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

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

Posted: Fri Apr 17, 2015 4:32 pm
by johnr@etakeoff.com
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?

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

Posted: Fri Apr 17, 2015 4:58 pm
by Tracker Supp-Stefan
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

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

Posted: Fri Apr 17, 2015 8:39 pm
by johnr@etakeoff.com
Works great.
Thanks for the help.

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

Posted: Fri Apr 17, 2015 8:43 pm
by Patrick-Tracker Supp
We are always happy to help. Stefan is off now so I will forward your thanks on to him.

Have a great weekend!