

Need help in the meantime? Contact our support team for free technical support! For pricing or licensing questions, you can contact our sales team via email or call us at +1-70. Stay Tuned For More Conversion Samplesĭid you see our previous post, “ Convert Multi-page TIFF to Searchable PDF in C#, Java, and C”? Stay tuned for more conversion examples to see how LEADTOOLS easily fits into any workflow converting PDF files into other document files or images and back again. It’s fully-functional for 60 days and comes with free chat and email support. See For Yourself – Free Evaluationĭownload the LEADTOOLS SDK for free. The library provides complete control over the processfor times you need to do more than just merge. The LEADTOOLS PDFFile class makes merging PDF files quick work for applications that will be running on Windows, ASP.NET, macOS, iOS, Android, and Linux.

New PDFFile(destinationFilePathString).mergeWith(ĪpyOfRange(sourceFilePathStrings, 1, sourceFilePathStrings.length), When processing PDF documents, we can combine several different PDF files arbitrarily or decompose a file into multiple. SourceFilePaths.Skip(1).ToArray(), destinationFilePath) New PDFFile(destinationFilePath).MergeWith( _ New PDFFile(destinationFilePath).MergeWith(

Private static void MergePdfFiles(string sourceFilePaths, string destinationFilePath)įile.Copy(sourceFilePaths.First(), destinationFilePath, true) Check to make sure number of args is correct, files exist, etc.
JAVA PDF MERGE CODE
In addition to PDF file merge, the PDFFile class provides much more including getting information about the file, getting PDF metadata, encrypting and decrypting PDFs, distilling PostScript to PDF, digital signing, bookmarking, annotating, and web optimizing.īelow are some C#, VB, and Java code snippets that can be used to combine PDF files into one PDF file. However, if all you need is to merge multiple PDF files into a single PDF file, LEADTOOLS has a PDFFile class that can combine PDF files with one-line of code. Just get and store the input file paths in a String array, then pass it to the mergeFiles method as one parameter, and then save the returned object as a new PDF file.We have done several posts that uses the LEADTOOLS Document Converter to convert and merge multiple images and documents, including PDF. To accomplish this task, Spire offers another easy-to-use method named mergeFiles. saveToFile ( outputDirectory + "output-2.pdf" ) saveToFile ( outputDirectory + "output-1.pdf" ) newDoc_2. getCount ()- 1 ) //save the new PDF documents newDoc_1. insertPageRange ( sourceDoc, 1, sourceDoc. insertPage ( sourceDoc, 0 ) //insert the rest pages from source file to the second new PDF document newDoc_2. loadFromFile ( inputFile ) //create two extra PdfDocument objects PdfDocument newDoc_1 = new PdfDocument () PdfDocument newDoc_2 = new PdfDocument () //insert the first page from source file to the new PDF document newDoc_1. specify input file path and output directory String inputFile = "C:/Users/Administrator/Desktop/test.pdf" String outputDirectory = "C:/Users/Administrator/Desktop/Output/" //create a PdfDocument instance PdfDocument sourceDoc = new PdfDocument () //load a source PDF file sourceDoc. Simply load the source PDF file to a PdfDocument object, and then call split method to do the division. Spire offers a quite straightforward mothed – split, to divide a multi-page PDF document into multiple single page based PDF documents.
JAVA PDF MERGE DOWNLOAD
Split PDF to several files by page rangesīefore you can compile the code snippets below, download Spire.PDF for Java and import the and into your project.There are three pieces of code in the sections below illustrating the split and merge from the following three aspects. This article is going to introduce how we can split a large PDF and merge multiple PDFs by using Spire.PDF for Java. For example, split a PDF containing multiple invoices into separate files, or combine several reports into a single PDF. As PDF file format is getting increasingly popular in business these days, office workers are often exposed to PDF documents and may also have the requirements to process the PDFs as well.
