I am trying to make a program that multiple users can share one PDF document , and every one can put his comments on the PDF using add sticky note without changing/modifying other notes. For example , The program will transfer that PDF file to another person for review and checking , the reviewer will put his comments on the PDF and send it to Approver person . The approver can't edit reviewer comments and change it at all , he can add new sticky note to it for his comments.
if I use the security on the PDF ( ~ PdfWriter.AllowModifyAnnotations ) , I will disable entering new sticky note.
is there any solution for that ?
please help me and thanks in advance
PDF annotation objects can have flags; one of these flags is a read-only flag. Thus, you only have to iterate over all annotations on all pages and set their respective read-only flag.
In iText 5.5.x this can be done like this:
(iText 5 MarkAnnotationReadOnly.java)
In iText 7.0.x it can be done like this
(iText 7 MarkAnnotationReadOnly.java)
Only the kernel iText 7 artifact is required.