I have been brought in to a project while the original coder is out of the country and not available for questions. In this program, we create pdf files using ITextRenderer and email them to vendors for signatures. They noticed recently that the files are editable, so they would be able to edit the terms.
Long fileId = System.currentTimeMillis();
ITextRenderer rendere = new ITextRenderer();
OutputStream file = null;
try{
String k = getFormHtml(cookies);
rendere.setDocumentFromString(k);
rendere.layout();`enter code here`
file = new FileOutputStream(new VKTPdfFile(fileId));
rendere.createPDF(file);
}
I see ITextRenderer has a function setPDFEncryption, to be filled with a PDFEncryption, but I can't find an example of how to use this. I simply want to disable editing; the user should be able to print, sign, scan, that's it.