Jasper Report - Set Author property in a PDF document

后端 未结 3 1611
萌比男神i
萌比男神i 2021-01-13 23:42

Is there a way to set the Author property to a PDF document by setting a parameter when calling Jasper from Java.

3条回答
  •  囚心锁ツ
    2021-01-14 00:10

    JRExporter became deprecated in 5.6 according to this post. I got it to work doing this:

        ...
        final JRPdfExporter exporter = new JRPdfExporter();
        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
        final SimplePdfExporterConfiguration configuration = new SimplePdfExporterConfiguration();
        configuration.setMetadataTitle(title);
        configuration.setMetadataAuthor(author);
        configuration.setMetadataCreator(creator);
        configuration.setMetadataSubject(subject);
        configuration.setMetadataKeywords(keywords);
        ...
    

提交回复
热议问题