PdfFileSignature bindpdf with password

Hello,
I’m having an issue: I need to clear usage rights/signature from .pdf file, but that file is protected with password. I’m unable to use BindPdf(Stream, string) because of its protection level. And using BindPdf(Stream) causes an error “invalid password”.
How could I solve this?

using (Aspose.Pdf.Facades.PdfFileSignature pdfSign = new Aspose.Pdf.Facades.PdfFileSignature())<span style=“font-family: “Courier New”;”>{
//pdfSign.BindPdf(vResultedStream, vPassword); //unaccessable
pdfSign.BindPdf(vResultedStream); //Error “invalid password”
try {
if ((pdfSign.ContainsUsageRights()))<span style=“font-family: “Courier New”;”>{
pdfSign.RemoveUsageRights();
}
}
catch (Exception ex){
string vMessage = ex.Message.ToString();
}
pdfSign.Document.Save(vNoSignatureStream);
}
pdf password: DCS
Aspose version: 11.2

Hi there,

Thanks for your inquriy. You can use following code snippet for opening password protected file with PdfFileSignature object. However it will not decrypt the password file.


Document doc = new Document(vResultedStream, vPassword);

pdfSign.BindPdf(doc);

Please check following documentation links for removing the security setting and signature of the PDF file, it will help you to accomplish the task.

Please feel free to contact us for any further assistance.

Best Regards,