.NET を使用して EPS ファイルを PDF に結合

Aspose.Page EPS Merger の品質を確認し、結果を確認するには、無料のオンラインツール EPS Merger をご利用ください。

Aspose.Page for .NET EPS Merger を使用すると、.NET プラットフォームでサポートされている任意の言語(C#、VB、J#)を使用して、Encapsulated PostScript (EPS) ファイルを PDF ドキュメントに結合できます。
EPS 結合を実行するには、いくつかの手順を実行する必要があります。

  1. 最初の EPS ファイルから PsDocument のインスタンスを作成します。
  2. 最初の EPS ファイルと結合する EPS ファイルの配列を作成します。
  3. PdfSaveOptions を使用して、AdditionalFontsFolderSuppressError ブール値を指定します。
  4. EPS ファイルと作成したドキュメントを結合し、PDF 保存オプションを使用して PDF として保存します。
  5. SuppressErrors 値が true(デフォルト)の場合、EPS ファイルと PDF ドキュメントの結合中に発生したエラーを確認できます。これらのエラーは Exceptions リストに保存されます。


次のコード スニペットは、C# で EPS ファイルを PDF ドキュメントに結合する方法を示しています。

 1/ For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-.NET
 2// The path to the documents directory.
 3string dataDir = RunExamples.GetDataDir_WorkingWithDocumentMerging();
 4// Initialize PS document with the first EPS file
 5PsDocument document = new PsDocument(dataDir + "input.eps");
 6
 7// Create an array of PostScript files that will be merged with the first one
 8string[] filesForMerge = new string[] { dataDir + "input2.eps", dataDir + "input3.eps" };
 9
10// If you want to convert Postscript file despite of minor errors set this flag
11bool suppressErrors = true;
12
13//Initialize options object with necessary parameters.
14PdfSaveOptions options = new PdfSaveOptions(suppressErrors);
15// If you want to add special folder where fonts are stored. Default fonts folder in OS is always included.
16options.AdditionalFontsFolders = new string[] { @"{FONT_FOLDER}" };
17
18// Default page size is 595x842 and it is not mandatory to set it in SaveOptions
19// But if you need to specify the page size following line
20//PdfSaveOptions options = new PdfSaveOptions(suppressErrors, new Aspose.Page.Drawing.Size(595, 842));
21
22document.MergeToPdf(dataDir + "outputPDF_out.pdf", filesForMerge, options);
23
24//Review errors
25if (suppressErrors)
26{
27    foreach (Exception ex in options.Exceptions)
28    {
29        Console.WriteLine(ex.Message);
30    }
31}

EPS マージについては、 Java および C++ を参照してください。

PdfSaveOptions について考えてみましょう。このクラスを使用すると、EPS を PDF にマージする際にさまざまな変換パラメータを指定できます。

EPS Merger で EPS マージ機能をオンラインで評価できます。

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

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.