How to remove restrictions of a pdf form

Hi All,


Here is the code I’m using, to remove the copy restriction

string filePath = Server.MapPath("~\pdf\");

PdfFileSecurity fileSecurity = new PdfFileSecurity(filePath + “US_IDS_Form__SB_08a.pdf”, filePath + “US_IDS_Form__SB_08a_NoRestriction_CanFill_copy.pdf”);

fileSecurity.SetPrivilege(DocumentPrivilege.Copy);

What I need to do is remove the Content Copying Restriction plus Filling of form fields and Page Extraction from the Ducument Restriction Summary:

To be more specific, here is a brief description of the Ducument Restriction Summary

You can acces , by pressing right click on the Acrobat document and chosing Document Properties , then select the tab Security , Now under Ducument Restriction Summary you could see something like this:

-----------Ducument Restriction Summary-----------------------------------
|
| Printing : Not Alowed
| Document Assembly: Not Alowed
| Content Copying: Allowed
| Content Copying for Accessibility: Allowed
| Page Extraction: Not Alowed
| Commenting: Not Alowed
| Filling of form fields: Not Alowed
| Signing: Not Alowed
| Creation of templates Pages: Not Alowed
|
|--------------------------------------------------------------------------------------------

Any idea on how to remove this restrictions???

BTW: I try using this:

DocumentPrivilege privilege = DocumentPrivilege.ForbidAll;
privilege.ChangeAllowLevel = 1;
privilege.AllowPrint = true;
privilege.AllowCopy = true;
privilege.AllowModifyContents = true;

But It doesn’t work.


The pdf form is Attached to this post.


I will apreciate your help.

Till next time.

Hi Alejandro,

Thank you very much for considering Aspose.

We're looking into the matter and you'll be updated the earliest possible.

We're sorry for the inconvenience.

Regards,

Hi Alejandro,

Please try the following code snippet at your end and see if it works:

PdfFileSecurity security = new PdfFileSecurity(common.Path("US_IDS_Form__SB_08a.pdf"), common.Path("US_IDS_Form__SB_08a_output.pdf"));

DocumentPrivilege privilege = DocumentPrivilege.ForbidAll;
privilege.AllowCopy = true;
privilege.AllowFillIn = true;
privilege.AllowModifyContents = true;

security.SetPrivilege(privilege);
If you still find any problem or have more questions, please do let us know.
Regards,