Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allow page extraction in a password security pdf with itextsharp

I don't know if it is possible to create a pdf with password security enabled, that also allows extraction of pages.

I havn't found any property in itextsharp which will allow enable page extraction.

Any one has any idea?

properties

This is the property that i would like to enable.

Thank you very much.

like image 504
Ruben de la Fuente Avatar asked Oct 31 '22 17:10

Ruben de la Fuente


1 Answers

I've taken a look at the permission bits in the draft of ISO-32000-2 and I've compared them with the parameters (written in ALL_CAPS) available in iText:

bit 1:  Not assigned
bit 2:  Not assigned
bit 3:  Degraded printing: ALLOW_DEGRADED_PRINTING
bit 4:  Modify contents: ALLOW_MODIFY_CONTENTS
bit 5:  Extract text / graphics: ALLOW_COPY
bit 6:  Add / Modify text annotations: ALLOW_MODIFY_ANNOTATIONS
bit 7:  Not assigned
bit 8:  Not assigned
bit 9:  Fill in fields: ALLOW_FILL_IN
bit 10: **Deprecated** ALLOW_SCREEN_READERS
bit 11: Assembly: ALLOW_ASSEMBLY
bit 12: Printing: ALLOW_PRINTING

When I compare the spec with your screen shot, I assume that the permissions are as follows:

  • Printing: ALLOW_DEGRADED_PRINTING or ALLOW_PRINTING
  • Changing the document: ALLOW_MODIFY_CONTENTS
  • Commenting: ALLOW_MODIFY_ANNOTATIONS
  • Form Field Fill-in or Signing: ALLOW_FILL_IN
  • Document Assembly: ALLOW_ASSEMBLY
  • Content copying: ALLOW_COPY
  • Content Accessibility Enabled: ALLOW_SCREENREADERS

I can't find any permission bit that refers to page extraction. I have tried setting all the flags that are documented in ISO-32000-2, but they didn't result in setting the Page Extraction to Allowed.

I have tried two things:

First I tried setting the bits that aren't assigned: bit 1, 2, 7, 8, 13, 14. This didn't change anything. Then I opened a test document in Acrobat and I tried finding a setting that would allow page extraction:

enter image description here

I couldn't find any.

As the permission isn't described in ISO-32000 and as there doesn't seem to be a way to set this permission in Acrobat, I'm inclined to believe that there is no way to set this permission. The only way to see "Allowed", is to open the document with the owner password.

Please update your question as soon as you find a way to set this permission with Acrobat. I'm using Acrobat XI Pro.

On another note: setting the permissions the way you do (using only an owner password and without a user password) is only a psychological, NOT a full-proof technical way to enforce protection. See How to read PDFs created with an unknown random owner password? to find out how to remove permissions from a PDF that is only protected using an owner password.

like image 191
Bruno Lowagie Avatar answered Nov 11 '22 09:11

Bruno Lowagie