Aspose.PDF for JasperReports 19.5

Features and Improvements

KeySummaryCategory
PDFJR-33202Adaptation Aspose.PDF for JasperReports for FIPS 186-4 standardNew Feature
PDFJR-33193Support PDFsecurityEnhancement
PDFJR-33201Update the JasperReports with Aspose.PDF version 19.4Enhancement
PDFJR-33200Synchronize with latest JasperReports versionEnhancement
PDFJR-22870Text margin information is not being honoredBug
PDFJR-29115Add topic in Documentation on how to apply Security RestrictionsBug

Public API Changes for version 19.5

Support PDF security

Support PDF security configuration.

usage:

 {

        JasperReport jasperReport = JasperCompileManager

                .compileReport(TESTDATA + "data.jr3.7/text.pdf/FontsTest.jrxml");

        HashMap<String, Object> params = new HashMap<String, Object>();

        params.put(JRParameter.REPORT_LOCALE, Locale.US);

        params.put(JRParameter.REPORT_TIME_ZONE, TimeZone.getTimeZone("GMT"));

        JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,

                params, new JREmptyDataSource(10));

        JrPdfExporter exporter = new JrPdfExporter();

        SimplePdfExporterConfiguration configuration = new SimplePdfExporterConfiguration();

        configuration.setPermissions(PdfExporterParameter.ALLOW_COPY | PdfExporterParameter.ALLOW_PRINTING);

        configuration.setUserPassword("test1");

        configuration.setOwnerPassword("test2");

        configuration.setEncrypted(true);

        exporter.setConfiguration(configuration);

        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));

        String fileName = TESTOUT + "jr_ALLOW_COPY_&_ALLOW_PRINTING_pass.pdf";


        exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(fileName));


        JrPdfExportParametersBean exportParameters = new JrPdfExportParametersBean();

        exportParameters.setSecuredMode(false);

        HashMap fontMap = new HashMap();

        fontMap.put("SansSerif", "Arial");

        fontMap.put("serif", "Times New Roman");

        fontMap.put("monospaced", "Courier");

        fontMap.put("Aharoni", "Arial");

        exportParameters.setFontsMap(fontMap);

        exporter.setFontsMap(exportParameters.getFontsMap());

        exportParameters.setLicenseFile(TESTDATA + "license/Aspose.PDF.JasperReports.lic");

        exporter.exportReport();

        assertTrue(new File(fileName).exists());

}