Hi I am looking for example to convert eps file to PDF using Aspose Imaging for Java. Can’t find any direct example
Attaching a simple EPS file for reference.
I tried to update sample code from Manipulating Photoshop Formats|Documentation
here is the code im using
EpsImage epsImage = (EpsImage) EpsImage.load(imagePath);
if(epsImage.hasRasterPreview()) {
if (epsImage.getPhotoshopThumbnail() != null)
{
// process Photoshop thumbnail if it's present
}
if (epsImage.getEpsType() == EpsType.Interchange)
{
// Get EPS Interchange subformat instance
EpsInterchangeImage epsInterchangeImage = (EpsInterchangeImage)epsImage;
if (epsInterchangeImage.getRasterPreview() != null)
{
// process black-and-white Interchange raster preview if it's present
}
}
else
{
// Get EPS Binary subformat instance
EpsBinaryImage epsBinaryImage = (EpsBinaryImage)epsImage;
if (epsBinaryImage.getTiffPreview() != null)
{
// process TIFF preview if it's present
}
if (epsBinaryImage.getWmfPreview() != null)
{
// process WMF preview if it's present
}
}
String pdfPath = imagePath + ".pdf";
PdfOptions exportOptions = new PdfOptions();
exportOptions.setPdfDocumentInfo(new com.aspose.imaging.fileformats.pdf.PdfDocumentInfo());
epsImage.save(pdfPath, exportOptions);
System.out.println("Converted to PDF");
}
else {
System.out.println("Raster Preview not available");
}
. 38233Y.EPS.zip (9.8 KB)