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!
![]() |
Merge Order with MergeDocument |
Post Reply ![]() |
Author | |
Luke ![]() Team Player ![]() ![]() Joined: 13 Aug 10 Location: USA Status: Offline Points: 26 |
![]() ![]() ![]() ![]() ![]() Posted: 09 Apr 14 at 12:00AM |
I need to merge two pdf's and am using the sample code (below). My problem is that sometimes the resultant PDF is sFile1 and then sFile2 and then other times it is sFile2 and then sFile1. What determines the merge order? Is there a better way? TIA.
// Read First Document FPDF.LoadFromFile( sFile1, '' ); iDoc1 := FPDF.SelectedDocument; // Read Second Document FPDF.LoadFromFile( sFile2, '' ); iDoc2 := FPDF.SelectedDocument; // Merge the two documents. FPDF.SelectDocument( iDoc1 ); FPDF.MergeDocument( iDoc2 ); // 08-Apr-2014 LMM: -> Save Result FPDF.SaveToFile( sMergedFile ); |
|
Luke M. Miller
ResCorSoft, Inc. |
|
![]() |
|
Wheeley ![]() Senior Member ![]() ![]() Joined: 30 Oct 05 Location: United States Status: Offline Points: 146 |
![]() ![]() ![]() ![]() ![]() |
Depending on what your ultimate goal is, you could use MergeFiles to merge the documents. Then you don't even have to open the files and the merge file list always contains the order of the files.
Wheeley p.s. Search the forum about merging to find example code. |
|
![]() |
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