Convert a Postscript PS or EPS file to PDF using Java

PostScript EPS PS to PDF Java

Postscript is page description language and the PS/EPS files are can contain text, graphics and different glyphs. You can convert a PS/EPS file to PDF file programmatically using Java. Please refer to the following sections for further details:

Postscript PS/EPS file to PDF Converter – Java API Installation

Aspose.Page for Java API supports working with the postscript files. You can render a PS or EPS file to a PDF document programmatically using Java. Simply download the JAR file from the New Releases section or use the below configurations in your pom.xml file:

Repository

 <repositories>
     <repository>
         <id>snapshots</id>
         <name>repo</name>
         <url>http://repository.aspose.com/repo/</url>
     </repository>

</repositories>

Dependency

 <dependencies>
    <dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-page</artifactId>
        <version>21.4</version>
    </dependency>
</dependencies>

Convert PS/EPS Postscript File to PDF Programmatically with Java

You can convert a PS or EPS file to PDF with the following steps:

  1. Initialize PDF output stream and PostScript input stream.
  2. Initialize PdfSaveOptions object with necessary parameters.
  3. Convert PS/EPS Postscript file to PDF.

The code below shows how to convert a PS or EPS file to PDF programmatically with Java:

Convert PS/EPS Postscript File to PDF with Advanced Options in Java

Here you will explore advanced options like setting the page size of output PDF document as well as the custom font folders and image quality. Please follow the following steps for converting a PS/EPS file to PDF Programmatically using Java:

  1. Initialize the input and output streams.
  2. Declare PsDocument class object.
  3. Set page size with PdfDevice class instance.
  4. Convert PS/EPS Postscript file to PDF.

The following code demonstrates how to convert a PS or EPS file to PDF Programmatically using Java:

Get Free API License

You can request Free Evaluation License to test the API in its full capacity.

Conclusion

In this article, you have learned how to work with Aspose.Page for Java API for converting a Postscript file like a PS or EPS to PDF file programmatically using Java. You can explore several other features of the API by visiting the Documentation. Please feel free to contact us at the Free Support Forum in case of any queries.

See Also

Convert OXPS or XPS to PDF Programmatically with Java