The below steps will demonstrate the way to set the password to the PDF file exported from the JasperReports Server :
To encrypt the pdf file please add these four properties to a jrxml, and upon export to PDF, you'll be prompted by your PDF reader for the password.
<property name="net.sf.jasperreports.export.pdf.encrypted" value="True"/>
<property name="net.sf.jasperreports.export.pdf.128.bit.key" value="True"/>
<property name="net.sf.jasperreports.export.pdf.user.password" value="myPass"/>
<property name="net.sf.jasperreports.export.pdf.owner.password" value="myPass"/>
Please refer to the below links for more details :
https://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.pdf.owner.password
https://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.pdf.user.password
Recommended Comments
There are no comments to display.
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