Add Pages to PDF via Java
Insert pages to PDF document programmatically using Aspose.PDF for Java Library
How to Add pages to PDF Using Java
In order to insert page, we’ll use Aspose.PDF for Java API which is a feature-rich, powerful and easy to use conversion API for Java platform. You can download its latest version directly from Maven and install it within your Maven-based project by adding the following configurations to the pom.xml.
Insert Page to PDF via Java
You need Aspose.PDF for Java to try the code in your environment.
-
Create a Document object with the input PDF file.
-
Call the PageCollection collection’s Insert method with specified index.
-
Save the output PDF using the Save method.