Last active
October 24, 2025 10:29
-
-
Save aspose-com-gists/1646e7bae1b37c99f0f78d65574f9a8f to your computer and use it in GitHub Desktop.
Develop a JPG to EPS Converter in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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