Is it possible
to populate the document properties of a PDF file if the PDF is only in
memory? I am using iText with FOP, which saves the generated
PDF to a stream (ByteArrayOutputStream outbuffer) and passed it on to iText
via a PdfReader before it is Encrypted. Sample code
below.
PdfReader reader = new PdfReader(outbuffer.toByteArray());
response.setContentType("application/pdf");
PdfEncryptor.encrypt(reader, response.getOutputStream(), true, null, "PASSWORD", permissions);
outbuffer.close();
response.setContentType("application/pdf");
PdfEncryptor.encrypt(reader, response.getOutputStream(), true, null, "PASSWORD", permissions);
outbuffer.close();
I appreciate any
suggestions. If possible I would like to avoid saving and loading the PDF
to/from disk.
Thanks,
Johannes