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

概要

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

Java で画像を EPS に変換する

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

Java による JPG から EPS への変換

Aspose.Page による JPG から EPS への変換品質を確認し、無料のオンライン ソフト JPG から EPS へのコンバーター で結果を確認できます。その後、EPS ビューアー で変換後の EPS ファイルを表示できます。


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

JPG から EPS への変換を行うには、以下の 2 つの手順を実行するだけです。

  1. PsSaveOptions のインスタンスを作成します。
  2. PsDocument の静的メソッドを使用します。 saveImageToEps メソッドには、ユーザーに JPG 画像を EPS に保存するための最も快適な方法を提供するための 4 つの変更点があります。

Javaで文字列を使用してJPGを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 JPG image to EPS file
10PsDocument.saveImageAsEps(dataDir + "input1.jpg", dataDir + "output1.eps", options);

Javaでストリームを使用してJPGを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 JPG image to EPS file
7PsDocument.saveImageAsEps(inputStream, outputStream, options);

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

以下の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 jpg = ImageIO.read(new FileInputStream(dataDir + "input1.jpg")))
11
12// Save JPG image to EPS file
13PsDocument.saveImageAsEps(jpg, dataDir + "output1.eps", options);

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

以下の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 jpg = ImageIO.read(new FileInputStream(dataDir + "input1.jpg")))
11
12// Create the output stream for EPS file
13OutputStream outputStream = new FileOutputStream(dataDir + "output1.eps"))
14
15// Save JPG image to EPS file
16PsDocument.saveImageAsEps(jpg, outputStream, options);

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

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

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

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.