How do I set the export pdf version at run time in Jasper?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
On your instance of
JRPdfExporter, call the methodsetParameterand use the constants defined inJRPdfExporterParameterto set the version appropriately.Example:
exporter.setParameter(JRPdfExporterParameter.PDF_VERSION, JRPdfExporterParameter.PDF_VERSION_1_2);There are constants for versions 1.2 through 1.7.
For your code, the solution would be something like this:
The pdf will then be written to
outputFile, so you won’t need to callprintReport.