Rank: Member
Groups: Registered
Joined: 7/26/2016(UTC) Posts: 25  Location: Somerset Thanks: 5 times
|
Hi, Does the PdfViewer control intentionally impose restrictions when filling encrypted PDF Acroforms? To explain my question in more detail, please find attached two PDFs: 'SimpleForm.pdf' - a simple PDF Acroform (created using LibreOffice Writer) with one text field and two check boxes. 'SimpleForm-WithOP.pdf' - the same form but signed and encrypted with the Owner Password 'pwd' and with permission bits set such that everything is allowed apart from 'Commenting', 'Form Field Fill-in or Signing' and 'Page Extraction' (as confirmed when the PDF is opened in Acrobat Reader and permissions are viewed in the dialog 'Document Properties' -> 'Security' tab -> 'Show Details...' button). If I load 'SimpleForm.pdf' into the Pdfium.NET PdfViewer control then the form fields can be edited, however if I load 'SimpleForm-WithOP.pdf' (without supplying the Owner Password) into PdfViewer then the fields cannot be edited. In this case is PdfViewer intentionally preventing editing? By way of comparison, if I load 'SimpleForm-WithOP.pdf' (without supplying the Owner Password) into Acrobat Reader then the form fields can be edited, whereas if I load into Foxit Reader then they cannot be edited. If PdfViewer is intentionally preventing form editing (and I suspect that it is) then is it your opinion that the behaviour of Adobe Reader is incorrect in this instance? Clarification of this issue would be greatly appreciated. Thank you. Terry.  SimpleForm.pdf (19kb) downloaded 2 time(s). SimpleForm-WithOP.pdf (67kb) downloaded 2 time(s).
|
|
|
|
|
|
Rank: Guest
Groups: Guests
Joined: 1/5/2016(UTC) Posts: 162
Was thanked: 5 time(s) in 5 post(s)
|
Hi. I have looked the file you provided. The "P" entrie of the encryption dictionary has a value: -1316. This means that the forms should not be editable. There are two possible explanations for the situation you described: 1. Acrobat Reader does not work correctly. 2. The file has incorrect format somewhere, so that Adobe Reader does not interpret it correctly. I can't create the file using Foxit or Adobe, that will have the same beavior as yours. Edited by moderator Tuesday, October 30, 2018 5:43:52 AM(UTC)
| Reason: Not specified
|
|
|
|
|
|
Rank: Guest
Groups: Guests
Joined: 1/5/2016(UTC) Posts: 162
Was thanked: 5 time(s) in 5 post(s)
|
Using Foxit PhantomPDF, I created a file protected by a user password where the flags specifying which operations are permitted contains the following bits: 1111101011010100. This parameter in your file contains: 1111101011011100. The difference is only in the 4th bit. My file is not edited either by Adobe Acrobat Reader or Foxit PhantomPDF. I can assume that the behavior of the Adobe Acrobat Reader is affected by this 4th bit. Edited by moderator Thursday, November 1, 2018 4:42:10 AM(UTC)
| Reason: Not specified
|
 1 user thanked Guest for this useful post.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 7/26/2016(UTC) Posts: 25  Location: Somerset Thanks: 5 times
|
Hi, many thanks for your helpful replies, which confirm my findings.
In my view Pdfium.NET and Foxit Reader behave correctly - the form fields should not be editable, whereas Adobe Reader behaves incorrectly.
As you say, the difference is in the 4th bit of the permissions ("Modify Content") - Adobe is allowing this to override the 6th and 9th bits that disallow "Commenting" and "Fill form fields", yet the PDF specification (Table 22) states: Bit position 4: "Modify the contents of the document by operations other than those controlled by bits 6, 9, and 11."
Originally I was uncertain as to whether Pdfium's behaviour was intentional or just fortuitous because the document was encrypted and so Pdfium was preventing all interaction regardless of the precise permissions. However, by playing around with other permissions values I have come to the conclusion that its behaviour is intentional. In which case there is one anomaly ... if I digitally sign a PDF Acroform using a certifying signature with certification level "Do not allow any changes to document" (with no encryption) then to be consistent Pdfium should prevent all form field editing, but it doesn't. (By comparison, in this case both Adobe Reader and Foxit Reader do prevent editing.) Therefore, my question for Pdfium support (Paul?) is, could they please modify the PdfViewer control to also prevent form filling in this case, or can they please suggest a way in which I can programatically disable the form fields displayed in PdfViewer?
Again, thanks for your help, it is appreciated.
Terry.
|
|
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close