Convert PS/EPS To PDF using Aspose.Page for Java - NullPointerException occurs

Dear Team,
I have issue in Ps and Eps File Format to convert Pdf.

Issue 1:
PS to PDF

Code
FileInputStream psStream = new FileInputStream(dataDir);
dataDir = fileNameWithOutExt + “_Original.pdf”;
FileOutputStream pdfStream = new FileOutputStream(dataDir);
PsDocument document = new PsDocument(psStream);
PdfSaveOptions options = new PdfSaveOptions();
com.aspose.eps.device.PdfDevice device = new com.aspose.eps.device.PdfDevice(pdfStream);
try {
document.save(device, options);
} finally {
psStream.close();
pdfStream.close();
}

Aspose Lib
Page 19.9
pdf 19.9

Java Version
JDK 1.8

Sample
PS.zip (59.5 KB)
EPS.zip (5.5 MB)

@rjnick

Could you kindly share the output PDF documents which were generated at your end. We will further proceed to assist you accordingly.

1 Like

Fig5_Original.zip (168 Bytes)

@rjnick

We tested the scenario in our environment while using Aspose.Page for Java 19.9 and noticed NullPointerException Exception being thrown by the API. i.e.

Exception in thread "main" java.lang.NullPointerException
    at com.aspose.page.internal.l01.I331.ll(Unknown Source)
    at com.aspose.page.internal.l01.I347.lif(Unknown Source)
    at com.aspose.page.internal.l01.I677.lif(Unknown Source)
    at com.aspose.page.internal.l01.I67l.lif(Unknown Source)
    at com.aspose.page.internal.l01.I554.lI(Unknown Source)
    at com.aspose.page.internal.l01.I61I.lif(Unknown Source)
    at com.aspose.page.internal.l01.I61I.lI(Unknown Source)
    at com.aspose.page.internal.l01.I61I.l0l(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)

Hence, we have logged following issues in our issue tracking system for your files gr11.eps, gr12.eps, gr13.eps and gr14.eps, Fig5.ps and Fig6.ps respectively:

  • PAGEJAVA-62
  • PAGEJAVA-63
  • PAGEJAVA-64
  • PAGEJAVA-65
  • PAGEJAVA-66
  • PAGEJAVA-67

We will further look into details of the issues and keep you posted with the status of their correction. Please be patient and spare us little time.

We are sorry for the inconvenience.

1 Like

Dear @asad.ali,
Thankyou for your quick response, and waiting for update.

@asad.ali
Can i please know issue PAGEJAVA-62,63,64,65,66 and 67 mentioned as closed. Will I able to know the updates made in that issue.?

@rjnick

The earlier logged ticket have been closed after investigation. Please download and use Aspose.Page for Java 19.10 and in case you still face any issue, please feel free to let us know.

1 Like

@asad.ali,
I Check with 7+ PS Format File, it works fine but EPS format not working well.

EPS Conversion Code.
FileInputStream psStream = new FileInputStream(dataDir);
dataDir = fileNameWithOutExt + “_Original.pdf”;
FileOutputStream pdfStream = new FileOutputStream(dataDir);
PsDocument document = new PsDocument(psStream);
PdfSaveOptions options = new PdfSaveOptions();
com.aspose.eps.device.PdfDevice device = new com.aspose.eps.device.PdfDevice(pdfStream);
try {
document.save(device, options);
} finally {
psStream.close();
pdfStream.close();
}

Generated Output & Input
EPS.zip (5.5 MB)

@rjnick

We are checking it and will get back to you shortly.

1 Like

@asad.ali,
Thankyou for your quick response,

@asad.ali
any update for closed ticket issue.

@rjnick

About EPS files related problem, a ticket with ID PAGEJAVA-79 has been logged in our issue management system for further investigation and resolution. For closed tickets, they have been resolved so please upgrade to Aspose.Page for Java 19.11 and then share your kind feedback with us.

We are sorry for the inconvenience.

1 Like

@Farhan.Raza,
File Conversion Done Successfully but the Converted File Resolution not good,
I convert the EPS to PDF by using Aspose.page but the PDF imgae Quality not good.
I attached the EPS file and Converted file for your Reference.
Samples.zip (1.2 MB)

Thank you.

@rjnick

Thank you for your kind feedback.

Would you please also specify if your recent comments are follow up for previously logged or some resolved ticket, or if this is a new problem you are reporting for first the time, so that we may proceed and assist you accordingly.

1 Like

Hi @Farhan.Raza
I checked the files with latest version, the file is being converted successfully…but i find their is a difference in the resolution of the image.

@resh05

Thank you for details.

We have logged a ticket with ID PAGEJAVA-82 in our issue management system for further investigations about difference in image resolution.

@Farhan.Raza
any Update

@rjnick

We regret to share that earlier logged ticket is not yet resolved. We will inform you for sure as soon as we have some certain news on ticket resolution. Please spare us little time.

We are sorry for the inconvenience.