bobc02 Posted September 28, 2019 Share Posted September 28, 2019 I'm using Java 8 with the net.sf.jasperreports.export.SimplePdfReportConfiguration class to generate a PDF from a template.All is working fine, except the when I exportConfig.setMetadataTitle("Invoice 29Sep2019 Example Co., Inc.") it does not get set. When viewing the downloaded PDF properties, the Title is empty. See scrn shot below.Plus, the name given to the PDF looks like a UUID. For example, 2a7f08fa-f6d1-4a0c-9cfe-714db849a124.pdf.Any ideas?Thanks,Java Code: JRDataSource dataSource = getDataSource(invoiceDOList); JasperReport report = getReport(templateXML); JasperPrint jasperPrint = JasperFillManager.fillReport(report, null, dataSource); JRPdfExporter exporter = new JRPdfExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); SimplePdfReportConfiguration reportConfig = new SimplePdfReportConfiguration(); reportConfig.setSizePageToContent(true); reportConfig.setForceLineBreakPolicy(false); SimplePdfExporterConfiguration exportConfig = new SimplePdfExporterConfiguration(); exportConfig.setMetadataAuthor("BobC"); exportConfig.setMetadataTitle("Invoice 29Sep2019 Example Co., Inc."); exportConfig.setAllowedPermissionsHint("PRINTING"); exporter.setConfiguration(reportConfig); exporter.setConfiguration(exportConfig);[/code]PDF Properties Scrn Shot: Link to comment Share on other sites More sharing options...
BOFR Posted August 21, 2020 Share Posted August 21, 2020 Hi,I've the same, have you solved it ?Thks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now