How to Merge Multiple PDF Files into a Single PDF File on Android

PlugPDF is not just a PDF reader. Among other things, it allows to merge several PDF files into a single PDF file. The transplantPage method of the PDFDocument class can be used for this purpose. With this method, you can easily copy & paste a PDF page from a document to another.

Merge Multiple PDF Files into a Single PDF File on Android

The transplantPage method will take two arguments, the source PDF object and the zero-based page index. This will copy the page from the source PDF object and paste it to the end of the destination PDF file.

The code snippet below will help you understand how the PDF merging process works. Do not forget to import com.epapyrus.plugpdf.core.PDFDocument.

As you can see, the transplantPage method is used to extract PDF pages from a PDF file to another file. Here’s an example.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *