Gaizka Posted July 4, 2013 Share Posted July 4, 2013 Hi! Is it possible to set a property of the PDF file generated directly from iReport? I found some generic properties for pdf, but nothing seems to be goodI need, for example, to set the author of a PDF file craeted through iReport and exported in PDF format.Any help is appreciated!Thanks,Gaizka Link to comment Share on other sites More sharing options...
augarte Posted July 8, 2013 Share Posted July 8, 2013 Hi Gaizka, Not sure how it works because I've never used it but it seems that this is what you want: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#METADATA_AUTHORMaybe you can directly set the property and its value in iReport: net.sf.jasperreports.engine.export.JRPdfExporterParameter.METADATA_AUTHORThere is a similar property METADATA_CREATOR. I really don't know which one is the difference between them but maybe you can use any of them to achieve what you want. Hope this help. Regards,Aitor Link to comment Share on other sites More sharing options...
Gaizka Posted July 11, 2013 Author Share Posted July 11, 2013 Hi Aitor! thanks, I had already seen those property but they do not seem to work when set in iReport...thanks for your suggestion! Link to comment Share on other sites More sharing options...
augarte Posted July 12, 2013 Share Posted July 12, 2013 Hi Gaizka, I've tried to set it through iReport but didn't work for me. Im my case, as I export the reports through java, I have a exporter method, to which I have added the both properties mentioned in the previous post: public void ExpToPdf (String Nam, List JasLst) /************************************************************************************************/ { try{ JRPdfExporter PdfExporter = new JRPdfExporter (); PdfExporter.setParameter (JRExporterParameter.JASPER_PRINT_LIST, JasLst); PdfExporter.setParameter (JRExporterParameter.OUTPUT_FILE_NAME, Nam); PdfExporter.setParameter (JRPdfExporterParameter.METADATA_AUTHOR, "Aitor Ugarte"); PdfExporter.setParameter (JRPdfExporterParameter.METADATA_CREATOR,"Ugarte Aitor"); PdfExporter.exportReport (); } catch (Exception e){ e.printStackTrace(); } } This worked for me, don't know if it is a valid solution for you. Hope this helps. Regards, Aitor 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