How to make a PDF non-editable

Q: Is there a good way to make a PDF file non-editable?

A: There are some options here:

  1. If you want to disable interaction within your app you can prevent to user to interact with the PDF. For example, with the Android PDFNet SDK you can use PDFViewCtrl.setInteractionEnabled(false). This will avoid users to enter new annotations or editing forms.
  2. There are security flags that other viewers besides ours honor; we let people edit these but don’t observe them ourselves:
  3. Alternatively, you can flatten the content. You could use flatten annotations:

Note that each application may or may not honor the security flags. Also, opening a flattened document in other viewers will not prevent them to add new content to the document.

For option 1 - can users still view all previous annotations and then scroll, zoom etc?

Yes, by default all the annotations are visible.

You can hide all annotations with PDFViewCtrl.setDrawAnnotations(false)

Or you can hide individual ones with PDFViewCtrl.hideAnnotation