Jump to content
We've recently updated our Privacy Statement, available here ×

PDF security. How to prohibit select/copy text?


goodidea

Recommended Posts

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

As far as I know, jasperreports generates pdf that cant have these limits. To do this you would need a special license from Adobe so that you may use a different version of pdf ( Where things are limited and allows editable fields etc ). This would make it impossible to release jasperreports for free since such a license is very, very expensive.
Link to comment
Share on other sites

Hi -- Are you talking about disallowing the user to use the mouse and select sections of the pdf and copy it to be pasted elsewhere?

 

I believe you can control some of that via JRPdfExporterParameter class, and the JRPdfExporterParameter.PERMISSIONS flag

 

I have tried it to some extent and I believe I was able to prevent copying of the contents.

 

Betty

Link to comment
Share on other sites

  • 1 year later...

Here you go (we allow just copy and printing)

 

hth

C-Box

Code:
exporter.setParameter(JRPdfExporterParameter.IS_ENCRYPTED, Boolean.TRUE);exporter.setParameter(JRPdfExporterParameter.IS_128_BIT_KEY, Boolean.TRUE);exporter.setParameter(JRPdfExporterParameter.USER_PASSWORD, "YourUserPW");exporter.setParameter(JRPdfExporterParameter.OWNER_PASSWORD, "YourOwnerPW");exporter.setParameter(JRPdfExporterParameter.PERMISSIONS,new Integer(PdfWriter.AllowCopy | PdfWriter.AllowPrinting));
Link to comment
Share on other sites

Hi,

Thanks for your prompt reply... =)

It's worked to not allow copy but allow printing. I just use the script as the following:-

exporter.setParameter(JRPdfExporterParameter.IS_ENCRYPTED, Boolean.TRUE);
exporter.setParameter(JRPdfExporterParameter.IS_128_BIT_KEY, Boolean.TRUE);
exporter.setParameter(JRPdfExporterParameter.PERMISSIONS,new Integer(PdfWriter.AllowPrinting));
 

Thanks~!

Regards,

yy

 

Link to comment
Share on other sites

  • 7 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...