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!
Insert pages to PDF file from other file PDF |
Post Reply |
Author | ||
kavaler
Beginner Joined: 19 Jan 10 Location: Baku Status: Offline Points: 13 |
Post Options
Thanks(0)
Posted: 20 Jan 10 at 3:35PM |
|
Hello
How can I insert pages to PDF file from other file PDF? |
||
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
|
Yes.
1. Open the first document. Open the second document. Create a new document. 2. You can extract the page you need from a second document. 3. You can extract the first part from your first document into a new document. 4. You can append the page from "2." at the new document. 5. You can append the second part of the first document from "3." at the new document. 6. Save the new document. Here you'll find the relevant functions: http://www.quickpdflibrary.com/help/quickpdf/PageManipulation.php Cheers, Ingo Edited by Ingo - 20 Jan 10 at 6:33PM |
||
kavaler
Beginner Joined: 19 Jan 10 Location: Baku Status: Offline Points: 13 |
Post Options
Thanks(0)
|
|
Hello
How can I append the page at the new document? |
||
kavaler
Beginner Joined: 19 Jan 10 Location: Baku Status: Offline Points: 13 |
Post Options
Thanks(0)
|
|
|
||
Jack
Team Player Joined: 03 Jun 09 Location: Lompoc, CA Status: Offline Points: 22 |
Post Options
Thanks(0)
|
|
This is something I have to do in my program a lot, so I came up with a process. I wrote a wrapper class that has a WorkingPDF and a ResultPDF (both instances of TQuickPDF). Here's my procedure for appending:
procedure TPDF.AppendWorkingPDF(var oPDFWorking, oPDFResult: TQuickPDF); var iDoc1, iDoc2: Integer; oPDFStream: TStream; sBuffer: String; begin oPDFStream := TStringStream.Create(sBuffer); FPDFWorking.SaveToStream(oPDFStream); //save your working PDF to a stream iDoc1 := FPDFResult.SelectedDocument; //get a handle on your result PDF Doc before changes oPDFStream.Seek(0, soFromBeginning); //don't forget to reset the stream cursor FPDFResult.LoadFromStream(oPDFStream); //adds the Working PDF Doc to the Result PDF //note that the Result PDF now has 2 docs if FPageNo = 1 then begin //the first doc in the Result PDF is the blank that QuickPDF starts with FPDFResult.RemoveDocument(iDoc1); end else begin iDoc2 := FPDFResult.SelectedDocument; //the Doc we just added from the stream FPDFResult.SelectDocument(iDoc1); //we stored this earlier FPDFResult.MergeDocument(iDoc2); //ta da! end; oPDFStream.Free; end; If, like me you are working with forms, then you should be aware that if you create a document with 50 pages and you have a field on each page named "Name", then all 50 pages will get whatever you put in last. For this, you need another process. Hope this is helpful. Jack |
||
kavaler
Beginner Joined: 19 Jan 10 Location: Baku Status: Offline Points: 13 |
Post Options
Thanks(0)
|
|
this is my e-mail
islam261@gmail.com adress please send me example(s) about this |
||
kavaler
Beginner Joined: 19 Jan 10 Location: Baku Status: Offline Points: 13 |
Post Options
Thanks(0)
|
|
hello
thank you very much for this code but I can't use this on my project I shall be very happy if you send me example(s) about this this is my e-mail islam261@gmail.com |
||
Jack
Team Player Joined: 03 Jun 09 Location: Lompoc, CA Status: Offline Points: 22 |
Post Options
Thanks(0)
|
|
Kavaler,
Actually, what I posted is an example. What you need to do now is try to apply the steps in the code to your situation. I see that there are actually a couple of problems in the code the way I originally posted it. Let me modify it here:
I think it is okay now. You should be able to drop this procedure into your code and then call it like
Give that a try and see if it works. -Jack |
||
kavaler
Beginner Joined: 19 Jan 10 Location: Baku Status: Offline Points: 13 |
Post Options
Thanks(0)
|
|
hello
thank you very vuch I thank you for everything |
||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store