Skip to footer content
IronPDF Logo for Java

How to Merge PDF files using iText in Java

  • Merge multiple PDF files into a single document seamlessly.
  • Incorporate PDF merging functionality into Java applications with ease.
  • Control the order and inclusion of specific pages from multiple PDFs.
  • Handle large PDF files efficiently during the merging process.
Trial key

Get your free 30-day Trial Key instantly.

Your trial license will be sent to this address

Check icon No credit card or account creation required

Test Icon

Test in a live environment

Test in production without watermarks.
Works wherever you need it to.

Functional Icon

Fully-functional product

Get 30 days of fully functional product.
Have it up and running in minutes.

Support Icon

24/5 technical support

Full access to our support engineering team during your product trial

HTML Files to PDF
import com.ironsoftware.ironpdf.*;
import java.io.IOException;
import java.nio.file.Paths;

// Apply your license key
License.setLicenseKey("YOUR-LICENSE-KEY");

// Set a log path
Settings.setLogPath(Paths.get("C:/tmp/IronPdfEngine.log"));

// Render the HTML as a PDF. Stored in myPdf as type PdfDocument;
PdfDocument myPdf = PdfDocument.renderHtmlFileAsPdf("example.html");

// Save the PdfDocument to a file
myPdf.saveAs(Paths.get("html_file_saved.pdf"));

Explore the code and run it to see the sample PDFs

World-Class Engineering,
24-Hour Support
  • Support Team Member 2 related to How to Merge PDF files using iText in Java
  • Support Team Member 4 related to How to Merge PDF files using iText in Java
  • Support Team Member 6 related to How to Merge PDF files using iText in Java
  • Support Team Member 7 related to How to Merge PDF files using iText in Java
  • Support Team Member Iron related to How to Merge PDF files using iText in Java
Talk to an Expert

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me