Python を使って EMF を EPS に変換する
この記事では、Python を使用して EMF を EPS に変換する 様々な方法について説明します。すべての方法を学習して、自分に最適な方法を見つけてください。
Python による EMF から EPS への変換
Aspose.Page による EMF から EPS への変換品質を確認し、無料のオンライン ソフト EMF から EPS へのコンバーター で結果を確認できます。その後、EPS ビューアー で変換後の EPS ファイルを表示できます。
EMF から EPS への変換を実行するには、次の 2 つの手順を実行する必要があります。
- PsSaveOptions のインスタンスを作成します。
- PsDocument の静的メソッド save_image_to_eps を使用します。
save_image_to_eps メソッドには、BMP 画像を EPS に保存するための最も快適な方法を提供するために、4 つの変更が加えられています。
Python で EMF を EPS に保存するための文字列の使用
次の Python コードスニペットでは、入力画像と出力 EPS ファイルが文字列で割り当てられています。
1# For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Python-.NET
2
3# The path to the documents directory.
4data_dir = Util.get_data_dir_working_with_image_conversion()
5
6# Create default options
7options = PsSaveOptions()
8
9# Save EMF image to EPS file
10PsDocument.save_image_as_eps(data_dir + "input1.emf", data_dir + "output1.eps", options)
Python で EMF を EPS に保存するためのストリームの使用
以下の Python コードスニペットでは、入力画像と出力 EPS ファイルがストリームによって割り当てられています。
1# For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Python-.NET
2
3# Create default options
4options = PsSaveOptions()
5
6# Save EMF image to EPS file
7PsDocument.save_image_as_eps(inputStream, outputStream, options)
Python で EMF を EPS に保存するには、Bitmap オブジェクトと文字列を使用します。
以下の Python コードスニペットでは、入力画像は aspose.pydrawing.Bitmap オブジェクトによって割り当てられ、出力 EPS ファイルは文字列によって割り当てられます。
1# For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Python-.NET
2
3# The path to the documents directory.
4data_dir = Util.get_data_dir_working_with_image_conversion()
5
6# Create default options
7options = PsSaveOptions()
8
9# Create the Bitmap object from the image file
10emf = aspose.pydrawing.Bitmap(open(dataDir + "input1.emf")))
11
12# Save EMF image to EPS file
13PsDocument.save_image_as_eps(emf, dataDir + "output1.eps", options);
Python で EMF を EPS に保存するための Bitmap オブジェクトとストリームの使用
次の Python コードスニペットでは、入力画像は aspose.pydrawing.Bitmap オブジェクトによって割り当てられ、出力 EPS ファイルはストリームによって割り当てられています。
1# For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Python-.NET
2
3# The path to the documents directory.
4data_dir = Util.get_data_dir_working_with_image_conversion()
5
6# Create default options
7options = PsSaveOptions()
8
9# Create the Bitmap object from the image file
10emf = aspose.pydrawing.Bitmap(open(dataDir + "input1.emf")))
11
12# Save EMF image to output stream
13PsDocument.save_image_as_eps(emf, outputStream, options);
.NET での EMF から EPS への変換をご覧ください。
EMF to EPS Converter で、EMF から EPS への変換をオンラインで評価できます。複数の EMF 画像を一度に EPS ファイルに変換し、数秒で結果をダウンロードできます。
サンプルファイルとデータファイルは GitHub からダウンロードできます。
その他の変換オプション: