We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.PDF JasperReports bad background quality and new API issues

Hello.
I am using the evaluation version of the jasper report pdf exporter in order to export filled and compiled jasper report to pdf. My jasper reports version is 6.1.0, the same with tool. When I export a report using old API, then the resulted pdf has a poor background image quality. I’ve tried with JasperStudio and here the background image has fine quality.
Also, when trying to use new API, I receive NullPointerException.
Any hints for that issues?
Here is a code snippet, using new API:

        JasperReport jasperReport = JasperCompileManager
                .compileReport(mainFormPath);
        JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,
                parameters, new JsonDataSource(new ByteArrayInputStream(jsonInString.getBytes("UTF-8"))));

        JrPdfExporter exporter = new JrPdfExporter();

        exporter.setPdfAMode(false);
        exporter.setPdfFormat(PdfFormatType.PDF_X_1A);
        exporter.setReportContext(new SimpleReportContext());
        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
        exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(outputFilePath));

        exporter.exportReport();

@Kustra94

Thank you for contacting support.

Would you please share respective source and generated files along with environment details (OS details, JDK/JRE version etc) so that we may try to reproduce and investigate it in our environment. Moreover, for compatibility with JasperReports v.6.1.0 a package aspose.pdf.jasperreports.jr6.1-1.6.0 has been included in Aspose.PDF for JasperReports 1.6.0. The name of the package must be considered when setting up the connection library in Jasperreport-Server in files applicationContext.xml and viewReportBeans.xml.

Furthermore, please note that we always recommend using latest version of the API and support is provided based on latest available version because it includes more features and bug fixes.

@Farhan.Raza
Thanks for fast reply. this problem occured on a latest version of jasperreports package, on Windows 10 with Java 8 64-bit. This one works
When using new API:
java.lang.NullPointerException
at com.aspose.pdf.jr.jasperreports.JrPdfExporter.exportReport(Unknown Source)
When using old API, it renders the file, but the quality is bad:
federal-K1.pdf (1000.7 KB)

@Kustra94

Thank you for sharing requested data and information. Would you please share a narrowed down sample application and source report as well so that we may proceed to reproduce and investigate it in our environment.

Well, I’m not able to provide source report. The application source has been given above. This problem with background quality occurs when PNG image is set as background. I would like to ask for a source code sample to use new Aspose.PDF for JasperReports. thanks in advance :slight_smile:

@Kustra94

The code snippet you have shared with us appears fine. Moreover, we need sample report to reproduce the issue in our environment. Please note that any attachment over forum is accessible to thread owner or our staff only as we take care of your data privacy. Moreover, we will soon share our version of code snippet to work with latest version of the API. Kindly spare us little time and share requested sample report with us in the meanwhile.