I sign a PDF file with multiple signatures using Aspose.PDF for .NET.When I open the file by Adobe Reader, all signatures show: “The Document has been altered or corrupted since the Signature was appiled” except the last one.How can I do?Thanks! This is my code base on the official example
string file = "E:\\Temp\\0.pdf";
// Create FormEditor object
FormEditor editor = new FormEditor();
editor.BindPdf(file);
// Add signature fields
editor.AddField(FieldType.Signature, "1", 1, 3149, 1390, 3324, 1477);
editor.AddField(FieldType.Signature, "2", 1, 3164, 1302, 3309, 1389);
// Save the form
file = "E:\\Temp\\1.pdf";
editor.Save(file);
for (int i = 1; i < 3; i++)
{
string signImageFile = "";
PKCS7Detached pkcs = null;
PdfFileSignature pdfSign = new PdfFileSignature();
System.Drawing.Rectangle signRect = new System.Drawing.Rectangle();
if (i == 1)
{
pkcs = new PKCS7Detached("E:\\Sign\\1.p12", "111111");
signImageFile = "E:\\Sign\\1.png";
signRect = new System.Drawing.Rectangle(3149, 1390, 175, 87);
}
else if (i == 2)
{
pkcs = new PKCS7Detached("E:\\Sign\\2.p12", "222222");
signImageFile = "E:\\Sign\\2.png";
signRect = new System.Drawing.Rectangle(3164, 1302, 145, 87);
}
pkcs.ShowProperties = false;
pdfSign.BindPdf(file);
pdfSign.Sign(i.ToString(), "", "", "", pkcs);
pdfSign.SignatureAppearance = signImageFile;
file = Path.Combine("E:\\Temp", (i + 1).ToString() + ".pdf");
pdfSign.Save(file);
pdfSign.Close();
}