Hello, I try to implement functionality which converts EPS files to PNG with Aspose.Pages library.
I have easy snippet:
FileInputStream inputStream = new FileInputStream(inputEPS); ImageSaveOptions options = new ImageSaveOptions(true); ImageDevice device = new ImageDevice(); device.setSaveOptions(options); PsDocument document = new PsDocument(inputStream); document.save(device, options);
But for filefile.zip (380.9 KB)
I receive ugly exception:
Exception in thread "main" java.lang.NullPointerException at com.aspose.page.internal.l04.I95I.lif(Unknown Source) at com.aspose.page.internal.l04.I57I.lIF(Unknown Source) at com.aspose.page.internal.l04.I63I.ll(Unknown Source) at com.aspose.page.internal.l04.I63I.ll(Unknown Source) at com.aspose.page.internal.l04.I63I.lI(Unknown Source) at com.aspose.eps.PsDocument.lI(Unknown Source) at com.aspose.eps.PsDocument.lif(Unknown Source) at com.aspose.eps.PsDocument.save(Unknown Source)
Can I know where is the problem? In you page Convert Images, Photos, Pictures Online (aspose.app) this image can be converted without problem.
I also notice that files which do not have image size in header like:
%%BoundingBox: 0 0 0 0 %%HiResBoundingBox: 0 0 0 0 %%CropBox: 0 0 0 0 %%LanguageLevel: 2 %%DocumentData: Clean7Bit %ADOBeginClientInjection: DocumentHeader "AI11EPS" %%AI8_CreatorVersion: 16.0.0 %AI9_PrintingDataBegin %ADO_BuildNumber: Adobe Illustrator(R) 16.0.0 x682 R agm 4.6676 ct 5.2591 %ADO_ContainsXMP: MainFirst
will be also problematic and library does not allow to convert it with error that size is unknown, but other apps which can handle EPS does not have any problem with that