Convert GIF to EPS using Java API Solution
Overview
This article explains how to convert GIF to EPS using Java. It covers the following topics.
- Java GIF to EPS
 - Java Convert GIF to EPS
 - Java Image to EPS
 - Java GIF from EPS
 - Java How to Convert GIF to EPS Programmatically
 - Java Save GIF as EPS
 
The Image to EPS conversion using Java from other formats like JPG, PNG, BMP are covered in these articles.
Java GIF to EPS Conversion
You can check the quality of Aspose.Page GIF to EPS conversion and view the results via free online GIF to EPS Converter and than view the resulting EPS file with our EPS Viewer
It is necessary to do just 2 steps in order to perform GIF to EPS conversion:
- Create an instance of PsSaveOptions.
 - Use static method saveImageToEps of PsDocument. saveImageToEps method has four modifications to provide a user with the most comfortable way to save GIF image to EPS.
 
Using strings for saving GIF to EPS in Java
In the following Java code snippet the input image and the output EPS file are assigned by strings:
1// Convert GIF image to EPS using files paths.
2
3// Create default options
4PsSaveOptions options = new PsSaveOptions();
5
6// Save GIF image to EPS file
7PsDocument.saveImageAsEps(getDataDir() + "input.gif", getOutputDir() + "output_gif.eps", options);Using streams for saving GIF to EPS in Java
In the following Java code snippet input image and output EPS file are assigned by streams:
 1// Convert GIF image to EPS using streams.
 2
 3// Create default options
 4PsSaveOptions options = new PsSaveOptions();
 5
 6// Create input stream from image
 7try (FileInputStream input = new FileInputStream(getDataDir() + "input.gif")) {
 8    // Create output stream for EPS
 9    try (FileOutputStream output = new FileOutputStream(getOutputDir() + "output_gif.eps")) {
10        // Save GIF image from input file stream to EPS file output stream
11        PsDocument.saveImageAsEps(input, output, options);
12    }
13} catch (IOException ex) {
14}Using BufferedImage object and string for saving GIF to EPS in Java
In the following Java code snippet input image is assigned by BufferedImage object and the output EPS file is assigned by string:
 1// Convert GIF image to EPS from Bitmap object to file.
 2
 3// Create default options
 4PsSaveOptions options = new PsSaveOptions();
 5
 6try {
 7	BufferedImage bmp = ImageIO.read(new java.io.File(getDataDir() + "input.gif"));
 8    // Save GIF bitmap to EPS file
 9    PsDocument.saveImageAsEps(bmp, getOutputDir() + "output_gif.eps", options);
10} catch (IOException ex) {
11}Using BufferedImage object and stream for saving GIF to EPS in Java
In the following Java code snippet input image is assigned by BufferedImage object and the output EPS file is assigned by stream:
 1// Convert GIF image to EPS from Bitmap object to stream.
 2
 3// Create default options
 4PsSaveOptions options = new PsSaveOptions();
 5
 6try {
 7	BufferedImage bmp = javax.imageio.ImageIO.read(new java.io.File(getDataDir() + "input.gif"));
 8    // Create output stream for EPS
 9    try (FileOutputStream output = new FileOutputStream(getOutputDir() + "output_gif.eps")) {
10        // Save GIF bitmap to EPS file stream
11        PsDocument.saveImageAsEps(bmp, output, options);
12    }
13} catch (IOException ex) {
14}See GIF to EPS conversion in .NET.
Evaluate GIF to EPS conversion online on our GIF to EPS Converter. You can convert several GIF image to EPS files at once and download the results in a few seconds.
You can download examples and data files from GitHub.