The reader enabled pdf can be annotated by several users, in a web browser.
However, when the PDF is retrieved, I want to store the users' username against the annotation/s made. The users details are only available at the time the application receives the request.
I cannot dynamically add any javascript, as this invalidates the hash applied to the PDF i.e. the javascript is classed as unmodifiable content.
I've tried adding the username as custom metadata using
i pdfDoc.getDocumentInformation().setCustomMetadataValue("currentUser", userName);
(and access it in the embedded javascript using 'this.info.currentUser')
but it seems this also invalidates the hash !!
So, my question is, how can i add the username dynamically to the PDF at request time, and access it in the embedded javascript, given that
* the available usage rights are for 'Annot.*'. (* is all available rights).
* the PDF is only reader enabled on creation (as reader enabling for large PDF files for multiple users is too slow!!)