Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Change order of pdf pages and save it
  FAQ FAQ  Forum Search   Register Register  Login Login

Change order of pdf pages and save it

 Post Reply Post Reply
Author
Message
mandriospo View Drop Down
Beginner
Beginner


Joined: 16 Dec 21
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote mandriospo Quote  Post ReplyReply Direct Link To This Post Topic: Change order of pdf pages and save it
    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?
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3437
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
mandriospo View Drop Down
Beginner
Beginner


Joined: 16 Dec 21
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote mandriospo Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3437
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
mandriospo View Drop Down
Beginner
Beginner


Joined: 16 Dec 21
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote mandriospo Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3437
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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.



Edited by Ingo - 21 Dec 21 at 10:20PM
Cheers,
Ingo

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store