How to remove restrictions of a pdf form.

Last post 07-01-2009, 11:53 AM by shahzad.latif. 2 replies.
Sort Posts: Previous Next
  •  06-30-2009, 1:15 PM 186198

    How to remove restrictions of a pdf form. .NET

    Attachment: Present (inaccessible)
    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.
                                          

       
     
  •  07-01-2009, 4:53 AM 186315 in reply to 186198

    Re: How to remove restrictions of a pdf form.

    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,

     


    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  07-01-2009, 11:53 AM 186440 in reply to 186315

    Re: How to remove restrictions of a pdf form.

    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,
     

    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML