Below are the steps and sample code to merge PDF files with and without options.
Steps to Merge PDFs
- Create a
MergeDocumentobject using the static
Mergemethod, passing in two PDFs to be merged.
- Call the
Drawmethod to save the merged PDF.
Sample code - Java
MergeDocument document = MergeDocument.Merge("C:\\DocumentA.pdf", "C:\\DocumentB.pdf"); document.Draw("C:\\Merged Output.pdf");
If you have additional PDFs to merge, you can append them by calling the
Sample code with Append - Java
MergeDocument document = new MergeDocument("C:\\DocumentA.pdf"); document.append("C:\\Append DocB.pdf", 1, 2); document.append("C:\\Append DocC.pdf"); document.draw("C:\\Appended Output.pdf");
DynamicPDF Merger Information
More information can be found here:
DynamicPDF Merger PDF Library is available for Java and COM/AxtiveX platforms. Refer to the respective product pages for more details.