Aspose.PDF for .NET multiple signatures - all signatures are invalid except the last one

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();
            }

@zlbao

Would you please also the sample PDF document and .p12 file for our reference. We will test the scenario in our environment and address it accordingly. You can please add your files to .zip format and attach them with your post.

Example.zip (521.4 KB)
@asad.ali

@zlbao

By using the shared code snippet and files with Aspose.PDF for .NET 21.3, we did not notice any issue. Both signatures were valid in the final PDF i.e. 3.pdf. For your kind reference, all output PDFs are attached.

3.pdf (147.2 KB)
2.pdf (129.4 KB)
1.pdf (116.7 KB)

Would you please try to test the scenario with 21.3v at your end. In case issue still persists, please let us know.

Hi, asad.ali,I try to the scenario with 21.3v that download from this page - Download .NET Component DLL to Process PDF | Aspose.PDF API
,but the issue still persists.Are we using different Aspose.PDF for .NET 21.3 of dll?
link.png (60.0 KB)
dll.png (9.7 KB)

@zlbao

There could not be any issue with the DLLs as we tested using the same. However, we tested while using a valid license. Could you please make sure that you are using the API with a valid or 30-days free temporary license. In case issue still persists, please let us know.

@asad.ali , the problem was solved by using a valid API with free temporary license .Thank you for your help!

@zlbao

It is good to know that your issue has been resolved. Please keep using our API and feel free to inform us in case you face any issue.