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.
Extract page form one PDF and put it in another
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan
-
- User
- Posts: 57
- Joined: Thu Jan 01, 1970 12:00 am
- Tracker Supp-Stefan
- Site Admin
- Posts: 13663
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Extract page form one PDF and put it in another
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
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
-
- User
- Posts: 57
- Joined: Thu Jan 01, 1970 12:00 am
Re: Extract page form one PDF and put it in another
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?
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?
- Tracker Supp-Stefan
- Site Admin
- Posts: 13663
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Extract page form one PDF and put it in another
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
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
-
- User
- Posts: 57
- Joined: Thu Jan 01, 1970 12:00 am
Re: Extract page form one PDF and put it in another
Works great.
Thanks for the help.
Thanks for the help.
- 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
We are always happy to help. Stefan is off now so I will forward your thanks on to him.
Have a great weekend!
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
Thank you.
Cheers,
Patrick Charest
Tracker Support North America