Do you have an issue with a specific file(s)? No. Can you reproduce using one of our samples or online demos? No. Are you using the WebViewer server? No. Does the issue only happen on certain browsers? No. Is your issue related to a front-end framework? No. Is your issue related to annotations? Yes.
Please give a brief summary of your issue:
I’m unable to download a PDF file that both (1) selectively disables annotations (flattens, sets ReadOnly, etc), while (2) continuing to allow users to select the annotation text in the downloaded document.
Please describe your issue and provide steps to reproduce it:
I’ve tried three approaches to this problem, with mixed success:
[Not Successful] Using getFileData() per the docs here. While getFileData() has a flatten option, I don’t see any options to specify that only some fields should be flattened.
[Not Successful] Setting the LockedContents flag here on the desired annotations to true, then calling getFileData(). However, annotations in the downloaded file are still editable.
[Partial Success] Setting the ReadOnly flag on the desired annotations to true, then calling getFileData(). This method successfully disabled editing the annotations in the downloaded document, but also prevents users from selecting text in the downloaded document. This is problematic for users who need to copy-paste information out of the PDF.
I have tried the ‘Locked’ and ‘LockedContent’ flags, but the annotations are still editable in both the WebViewer and downloaded PDF File. I think I’m calling the flag setting function correctly, but perhaps you can tell me if this is wrong:
Note, this successfully sets the ReadOnly flag: annotation.fieldFlags.set('ReadOnly', true)
However, this is not causing the annotation to be locked: annotation.fieldFlags.set('Locked', true); annotation.fieldFlags.set('LockedContents', true);