Print Page | Close Window

Merge Order with MergeDocument

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=2862
Printed Date: 16 Jun 25 at 1:48PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Merge Order with MergeDocument
Posted By: Luke
Subject: Merge Order with MergeDocument
Date 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.



Replies:
Posted By: Wheeley
Date Posted: 09 Apr 14 at 10:37PM
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.



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