Is there a way to set the Author property to a PDF document by setting a parameter when calling Jasper from Java.
This is how I generate a Jasper report from Java.
JasperPrint jasperPrint;
String outFile = "39285923953222.pdf";
HashMap hm = new HashMap();
hm.put("ID",id);
hm.put("FOOTER",Constants.FOOTER); // Set somehow a string for the author name
Session session = this.sessionFactory.openSession();
Connection con = session.connection();
jasperPrint = JasperFillManager.fillReport(jasperPath + "myReport.jasper", hm, con);
JasperExportManager.exportReportToPdfFile(jasperPrint, outPath + outFile);
Not sure if it is the right way to go, but you might want to look at
jasperPrint.getPropertyNames()
orjasperPrint.getPropertiesMap()
and see if you have any author property in there.Look at static field METADATA_AUTHOR in JRPdfExporterParameter.
Use JRPdfExporter instead of
JasperExportManager
.Example :
JRExporter became deprecated in 5.6 according to this post. I got it to work doing this: