We are encrypting our PDF with the following iText code. However, someone was able to edit our pdf (I am not sure how).
pdfWriter.setEncryption(null, null, PdfWriter.ALLOW_SCREENREADERS
| PdfWriter.ALLOW_COPY | PdfWriter.ALLOW_PRINTING,
PdfWriter.ENCRYPTION_AES_128);
Is there a better way for us to secure the pdf to prevent this?
PDF Encryption and restriction of information relies purely on the goodwill of the authors of the viewer software to enforce that restriction.
Generally speaking, every application that has enough information to display the PDF has enough information to print the PDF, there's nothing really you can do about it.
Since there are plenty of open-source PDF viewers out there, it's very easy to produce a viewer that simply ignores those restrictions.
See this explanation of the PDF encryption mechanism for more detail.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With