We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF security permissions

Hi,


I’m trying to set the permissions for a PDF document with aspose.Pdf.
I’d like to allow the end user to have all permissions.

Here’s my code:
Permissions Permission = (Permissions.PrintingQuality | Permissions.PrintDocument | Permissions.ModifyTextAnnotations | Permissions.FillForm | Permissions.ModifyContent | Permissions.ExtractContentWithDisabilities | Permissions.ExtractContent | Permissions.AssembleDocument);

doc.Encrypt(“UserPassword”, null, Permission, CryptoAlgorithm.RC4x128);

doc.Save(Path);

I get the same result if I do:
doc.Encrypt(“UserPassword”, null, DocumentPrivilege.AllowAll, CryptoAlgorithm.RC4x128,true);

If I open the document with my pdf reader, I see that the “Page Extraction” permission is not allowed.
Is there any way to set it?

Thanks,
Devid.

Hi Devid,


I
have tested the scenario and I am able to reproduce the same problem that page extraction restriction cannot be removed from PDF file. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-35406. We
will investigate this issue in details and will keep you updated on the status
of a correction. <o:p></o:p>

We apologize for your inconvenience.

The issues you have found earlier (filed as PDFNEWNET-35406) have been fixed in Aspose.Pdf for .NET 9.3.0.

Blog post for this release can be viewed over this link


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Devid,


Thanks for your patience. We have further investigated and would like to suggest you that you may use Adobe Acrobat to extract the pages as Adobe Reader does not support the feature.

Please feel free to contact us for any further assistance.

Best Regards,

Hi Devid,


Thanks for your patience.

In order to accomplish your requirement, please try using following code snippet.

[C#]

string f1 = @“C:\pdftest\36395_1.pdf”;<o:p></o:p>

string f2 = @"C:\pdftest\36395_1_OUT.pdf";

Aspose.Pdf.Document doc = new Document(f1);

Aspose.Pdf.Permissions Permission = (

Permissions.PrintingQuality |

Permissions.PrintDocument |

Permissions.ModifyTextAnnotations |

Permissions.FillForm |

Permissions.ModifyContent |

Permissions.ExtractContentWithDisabilities |

Permissions.ExtractContent |

Permissions.AssembleDocument);

doc.Encrypt("UserPassword", null, Permission, CryptoAlgorithm.RC4x128);

doc.Save(f2);

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan