Hello,
I am using Aspose.Page to convert EPS files to PNG format in which I am facing following issues:
-
For most of the EPS files, a blank PNG is generated. Sample EPS files and their PNG output for this issue are:
BlankEps.zip (407.0 KB) -
For a few EPS files, output was generated but it was incorrect. The PNG generated has the actual image at the bottom left corner and there is a lot of extra space above and at the right of that image. The PNG should look exactly like the EPS and there should not be any extra blank space surrounding the image. Sample EPS files and their PNG output for this issue are:
IncorrectEPS.zip (338.7 KB)
The sample code used to generate the PNG is:
FileInputStream psStream = new FileInputStream("filename.eps");
PsDocument document = new PsDocument(psStream);
boolean suppressErrors = true;
ImageSaveOptions options = new ImageSaveOptions(suppressErrors);
ImageDevice device = new ImageDevice();
document.save(device, options);
psStream.close();
byte[][] imagesBytes = device.getImagesBytes();
int i = 0;
for (byte [] imageBytes : imagesBytes) {
FileOutputStream fs = new FileOutputStream("filename" + i + ".png");
fs.write(imageBytes, 0, imageBytes.length);
fs.close();
i++;
}
Can you please look into this issue.
Thanks,
Neha