Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active October 24, 2025 10:29
Show Gist options
  • Select an option

  • Save aspose-com-gists/1646e7bae1b37c99f0f78d65574f9a8f to your computer and use it in GitHub Desktop.

Select an option

Save aspose-com-gists/1646e7bae1b37c99f0f78d65574f9a8f to your computer and use it in GitHub Desktop.
Develop a JPG to EPS Converter in Java
package com.example;
import java.io.IOException;
import com.aspose.eps.PsDocument;
import com.aspose.eps.device.PsSaveOptions;
import com.aspose.page.License;
public class main {
public static void main(String[] args) throws IOException {
try {
// Set the path for working directory and load the Aspose.Page license.
String dataDir = "files";
License lic = new License();
lic.setLicense(dataDir + "license.lic");
// Create an object of the PsSaveOptions class.
PsSaveOptions options = new PsSaveOptions();
// Save JPEG image to EPS file by invoking the saveImageAsEps method.
PsDocument.saveImageAsEps(dataDir + "sample.jpg", dataDir + "output1.eps", options);
System.out.println("JPG to EPS Conversion successful!");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment