Merge PS via Java
Merge PS documents in a browser without needing Adobe Acrobat or Automation with Java.
Merge PS files Using Java
In order to merge PS, we’ll use Aspose.PDF for Java API which is a feature-rich, powerful, and easy-to-use concatenation 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. Our Java Library can convert a document from any supported download format to any supported save format. Aspose.PDF for Java library provides fairly universal solutions that will help you solve the tasks of converting documents. Aspose.PDF supports the largest number of popular document formats, both for loading and saving. Draw your attention that the current section describes only popular conversions. The current page provides information about converting the format to format. However, there are many combinations for converting your files. For a complete list of supported formats, see the section Supported File Formats. Check the details of Installing the Library on the Documentation pages.
Repository
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/</url>
</repository>
Dependency
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-pdf</artifactId>
<version>version of aspose-pdf API</version>
<classifier>jdk17</classifier>
</dependency>
Convert PS in Java
Try our PS Converter to efficiently convert your documents. Convert PS files programmatically. Choose from over 48 available formats to create your own convertible document. You can also convert to many other available formats. Converting PS is just one of the ways our tool can convert your files. PS conversion may seem complicated until you try a professional tool to do this task. Use Java to convert PS files with maximum quality and speed.How to Merge PS files via Java
You need Aspose.PDF for Java to try the code in your environment.
- Open first document.
- Open second document.
- Add pages of second document to the first.
- Save concatenated output file
System Requirements
Just make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with Java Runtime Environment for JSP/JSF Application and Desktop Applications.
- Development environment like Eclipse or IntelliJ IDEA.
- Aspose.PDF for Java library referenced in your project.
Java - example code to merge PS file.
PsLoadOptions option = new PsLoadOptions();
Document document1= new Document("image1.ps", option);
Document document2= new Document("image2.ps", option);
// Add pages of second document to the first
document1.getPages().add(document2.getPages());
// Save concatenated output file
document1.save(_dataDir+"ConcatenatePdfFiles_out.pdf");