Java/ Convert PDF to PostScript

Import JAR Dependency

<repositories>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>https://repo.e-iceblue.com/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.pdf.free</artifactId>
<version>4.3.0</version>
</dependency>
</dependencies>

Sample Code

  • Create a PdfDocument object.
  • Load a sample PDF file using PdfDocument.loadFromFile() method.
  • Save the document as PostScript using PdfDocument.saveToFile() method.
import com.spire.pdf.*;

public class PDFToPS {
public static void main(String[] args) {

//Load a pdf document
PdfDocument doc = new PdfDocument();
doc.loadFromFile("C:\\Users\\Administrator\\Desktop\\Travel.pdf");

//Convert to PostScript file
doc.saveToFile("output.ps", FileFormat.POSTSCRIPT);

}
}

--

--

--

Sharing Java Code

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Back to Basics: Data Structures in JS

AWS CDK and Typescript: Deploy a static React app to S3

Young person watching the sea. The beginning of a learning path.

Returning To AngularJS (After Angular 2+)

Crash Course: Binary Search Tree JS

Creating Mentions And Hashtags In ReactJS

An Ethereum NodeJs oracle that executes JavaScript from Solidity

Spectron for electron apps automation

A dive into higher order JS functions

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrew Wilson

Andrew Wilson

Sharing Java Code

More from Medium

JAVA & Git-Hub

Create simple Spring-Boot application

JAVA /Super Keyword

Java Rest API with Spring Boot & JPA(Part-1)