Print Page | Close Window

Change order of pdf pages and save it

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=3966
Printed Date: 26 Apr 24 at 1:33AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Change order of pdf pages and save it
Posted By: mandriospo
Subject: Change order of pdf pages and save it
Date Posted: 16 Dec 21 at 9:34AM
Hey guys, this is my first post here. I am beginner and I am looking for the best way to solve my problem.
I have several pdf files with multiple pages. I need to change the order of the pages in these files and combine all into new 1 pdf file.
I think the best way is to save each pdf file into array where each element of array is a single page of that file. Then I can sort this array with my way and save that array into one pdf. I don't know if this scenario is possible to achieve. Please give me some advices. What metods to use?



Replies:
Posted By: Ingo
Date Posted: 16 Dec 21 at 9:03PM
Hi Mandriospo,

with QuickPDF you can split larger pdf-files into single pages.
In a second step you can merge these single pages via MergeFileList into a new pdf with a new order.
Here's a function to split the pdf:
https://www.debenu.com/docs/pdf_library_reference/ExtractFilePages.php
Here's a kb about how to merge:
https://www.debenu.com/kb/merge-pdf-files-together-programmatically/

BTW:
Here's the reference guide:
http://www.debenu.com/docs/pdf_library_reference/FunctionGroups.php
Here's the developer guide:
http://www.debenu.com/products/development/debenu-pdf-library/help/developer-guide/

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo



Posted By: mandriospo
Date Posted: 17 Dec 21 at 8:20AM
Ok thank you for your reply and advices. I am wondering if ExtractFilePages is best option? It is little bit messy to create like 1000 new pdf files. I was thinking to split pdf file with multiple pages into memory. Is it possible? I wish to split pdf object into pages which I can hold programatically in array and then merge it all together into one pdf file.


Posted By: Ingo
Date Posted: 17 Dec 21 at 8:45AM
You think it's better to manage "1000 new pdf" objects in ram? ;-)
But ... Yes ... You can do it in memory as well.
Have a look at "MergeStreams":
https://www.debenu.com/docs/pdf_library_reference/MergeStreams.php
For further investigations you can try your keywords to find kb-aricles and much more here:
https://www.debenu.com/docs/pdf_library_reference/Search.php



-------------
Cheers,
Ingo



Posted By: mandriospo
Date Posted: 21 Dec 21 at 8:19PM
My idea how to solve my problem:
1. Load all pdf files and use CapturePage function for each page and save id of captured process into array
2. Sort my array
3. Create new pdf document
4. Loop through my array and create new page and draw captured pages with my order

What do you think abou this idea?


Posted By: Ingo
Date Posted: 21 Dec 21 at 10:19PM
The idea sounds good but i myself didn't do this before.
I fear some memory probs could raise doing this with many pages in one instance.
Try it and share your experiences with us here.



-------------
Cheers,
Ingo




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