benoitx Posted January 23, 2009 Share Posted January 23, 2009 HelloWe are exporting our JasperReport in PDF and I was wondering how it would be possible to set the following attributes that are visible through Acrobat Reader | Properties (see image pdf-export.PDF).More specifically: the Title, Author, Subject and KeywordsWe do the export as follows... How could pass these attributes to the exporter?Many thanks!BenoitCode:try { final JRPdfExporter exporter = new JRPdfExporter(); final File destFile = new File(fileName); exporter.setParameter(JRExporterParameter.JASPER_PRINT, report); exporter.setParameter(JRExporterParameter.OUTPUT_FILE, destFile); exporter.setParameter(JRPdfExporterParameter.IS_ENCRYPTED, Boolean.TRUE); exporter.setParameter(JRPdfExporterParameter.IS_128_BIT_KEY, Boolean.TRUE); exporter.setParameter(JRPdfExporterParameter.PERMISSIONS, new Integer(PdfWriter.ALLOW_COPY | PdfWriter.ALLOW_PRINTING)); exporter.exportReport();... Link to comment Share on other sites More sharing options...
benoitx Posted January 23, 2009 Author Share Posted January 23, 2009 Hum... I should have checked JRPdfExporterParameter.METADATA_TITLE and co before posting this.. Sorry! Will try it now... Benoit 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