Java APIソリューションを使用したGIFからEPSへの変換

概要

この記事では、Java を使用して GIF を EPS に変換する方法 について説明します。以下のトピックを取り上げます。

Java で画像を EPS に変換する

これらの記事では、Java を使用して JPG、PNG、BMP などの他の形式から EPS に変換する方法について説明します。

Java GIFからEPSへの変換

Aspose.Page GIFからEPSへの変換品質を確認し、無料のオンラインツール GIF to EPS Converter で結果を確認できます。その後、EPS視聴者


Aspose.Page for Java の GIF から EPS へのコンバーターを使用すると、Java 仮想マシンが動作するあらゆる OS で GIF 画像を Encapsulated PostScript (EPS) ファイルに変換できます。
手順: Java での GIF から EPS へのコンバーター API コード

GIFからEPSへの変換は、以下の2つの手順で実行できます。

  1. PsSaveOptions のインスタンスを作成します。
  2. PsDocument の静的メソッドを使用します。 saveImageToEps メソッドには、GIF 画像を EPS 形式に保存するための最も簡単な方法を提供するために、4 つの変更が加えられています。

Java で文字列を使用して GIF 画像を EPS 形式に保存する

次の Java コードスニペットでは、入力画像と出力 EPS ファイルが文字列で割り当てられています。

 1// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Java
 2
 3// The path to the documents directory.
 4String dataDir = getDataDir();
 5
 6// Create default options
 7PsSaveOptions options = new PsSaveOptions();
 8
 9// Save GIF image to EPS file
10PsDocument.saveImageAsEps(dataDir + "input1.gif", dataDir + "output1.eps", options);

Javaでストリームを使用してGIFをEPSに保存する

以下のJavaコードスニペットでは、入力画像と出力EPSファイルがストリームによって割り当てられています。

1// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Java
2
3// Create default options
4PsSaveOptions options = new PsSaveOptions();
5
6// Save GIF image to EPS file
7PsDocument.saveImageAsEps(inputStream, outputStream, options);

JavaでGIFをEPSファイルに保存するためにBufferedImageオブジェクトと文字列を使用する

以下のJavaコードスニペットでは、入力画像はBufferedImageオブジェクトによって割り当てられ、出力EPSファイルは文字列によって割り当てられています。

 1// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Java
 2
 3// The path to the documents directory.
 4String dataDir = getDataDir();
 5
 6// Create default options
 7PsSaveOptions options = new PsSaveOptions();
 8
 9// Create the BufferedImage object from the image file
10BufferedImage gif = ImageIO.read(new FileInputStream(dataDir + "input1.gif")))
11
12// Save GIF image to EPS file
13PsDocument.saveImageAsEps(gif, dataDir + "output1.eps", options);

JavaでGIFをEPSファイルに保存するためにBufferedImageオブジェクトとストリームを使用する

以下のJavaコードスニペットでは、入力画像はBufferedImageオブジェクトによって割り当てられ、出力EPSファイルはストリームによって割り当てられます。

 1// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Java
 2
 3// The path to the documents directory.
 4String dataDir = getDataDir();
 5
 6// Create default options
 7PsSaveOptions options = new PsSaveOptions();
 8
 9// Create the BufferedImage object from the image file
10BufferedImage gif = ImageIO.read(new FileInputStream(dataDir + "input1.gif")))
11
12// Create the output stream for EPS file
13OutputStream outputStream = new FileOutputStream(dataDir + "output1.eps"))
14
15// Save GIF image to EPS file
16PsDocument.saveImageAsEps(gif, outputStream, options);

.NET での GIF から EPS への変換をご覧ください。

GIF to EPS Converter で、GIF から EPS へのオンライン変換をお試しください。複数の GIF 画像を一度に EPS ファイルに変換し、数秒でダウンロードできます。

サンプルファイルとデータファイルは GitHub からダウンロードできます。

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.