Hi,
I am trying to sign digital signature on the PDF file using .NET5 Library version 21.12.0. See the code below… It’s the same code from this link.
public void SignPdf(DigitalSignature signature, string inFile, int pageNumber, string outFile)
{
using (Document document = new Document(inFile))
{
using (PdfFileSignature pdfFileSignature = new PdfFileSignature(document))
{
PKCS7 pkcs = new PKCS7(signature.PFXFile, signature.Password);
pdfFileSignature.Sign(pageNumber, signature.IsVisible, new System.Drawing.Rectangle(100, 60, 250, 25), pkcs);
pdfFileSignature.Save(outFile);
}
}
}
However, I found that this code work perfectly, if I switched to .NET Framework.
signature.jpg (229.1 KB)
Please suggest me what I should do.