Unisci file EPS in PDF utilizzando Java

Puoi verificare la qualità di Aspose.Page EPS Merger e visualizzare i risultati tramite EPS Merger online gratuito

Aspose.Page per Java EPS Merger consente di unire file Encapsulated PostScript (EPS) a documenti PDF su qualsiasi sistema operativo che supporti Java Virtual Machine.
Per eseguire l’unione di file EPS in PDF sono necessari diversi passaggi:

  1. Creare un’istanza di PsDocument dal primo file EPS.
  2. Creare un array di file EPS che verranno uniti al primo. 3. Utilizzare PdfSaveOptions per specificare i valori booleani AdditionalFontsFolder e SuppressError.
  3. Unire i file EPS al documento creato e salvarlo in PDF con le opzioni di salvataggio PDF.
  4. Se il valore SuppressErrors è impostato su true, come predefinito, è possibile visualizzare gli errori generati durante l’unione dei file EPS in un documento PDF e salvati nell’elenco Eccezioni.


Il seguente frammento di codice mostra come unire i file EPS in un documento PDF in Java:

 1// Merge several EPS files to one PDF document.
 2
 3// Initialize PS document with the first EPS file
 4PsDocument document = new PsDocument(getDataDir() + "input.eps");
 5
 6// Create an array of PostScript files that will be merged with the first one
 7String[] filesForMerge = new String[] { getDataDir() + "input2.eps", getDataDir() + "input3.eps" };
 8
 9// If you want to convert Postscript file despite of minor errors set this flag
10boolean suppressErrors = true;
11
12//Initialize options object with necessary parameters.
13PdfSaveOptions options = new PdfSaveOptions(suppressErrors);
14// If you want to add special folder where fonts are stored. Default fonts folder in OS is always included.
15options.setAdditionalFontsFolders(new String[] { "{FONT_FOLDER}" });
16
17// Default page size is 595x842 and it is not mandatory to set it in SaveOptions
18// But if you need to specify the page size following line
19//PdfSaveOptions options = new PdfSaveOptions(suppressErrors, new java.awt.Dimension(595, 842));
20
21document.mergeToPdf(getOutputDir() + "outputPDF_out.pdf", filesForMerge, options);
22
23//Review errors
24if (suppressErrors) {
25    for (Exception ex : options.getExceptions()) {
26        System.out.println(ex.getMessage());
27    }
28}

Vedi Unione EPS in .NET e C++.

Consideriamo PdfSaveOptions. Utilizzando questa classe possiamo assegnare diversi parametri di conversione durante l’unione di file EPS in PDF.

Valuta l’unione di EPS online sul nostro EPS Merger.

Puoi scaricare esempi e file di dati da GitHub.

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.