Dear Guy
we encountered a new problem while retrieving the signature info by component Asepose.PDF which version is 23.11 . It exists till after we upgrade it into version 24.08 .
bellow is the code and we find the producer of PDF is 'PDFSharp 1.32.2608-g' .
PdfFileSignature pdfSign = new PdfFileSignature();
pdfSign.BindPdf("d:\\1.pdf");
@wengyeung
It seems you are encountering an issue while retrieving signature information from a PDF document using Aspose.PDF version 23.11, and the problem persists even after upgrading to version 24.08.
To troubleshoot this issue, you can refer to the following steps:
-
Verify the PDF File: Ensure that the PDF file you are trying to access is not corrupted and that it contains valid signatures. You can use a PDF viewer to check if the signatures are visible and valid.
-
Check Signature Verification: You can use the PdfFileSignature
class to verify the signatures in the PDF. Here’s a sample code snippet that demonstrates how to check if a signature exists and verify it:
using Aspose.Pdf.Facades;
public class SignatureVerification
{
public static void VerifySignature(string pdfFilePath, string signatureName)
{
try
{
PdfFileSignature pdfSign = new PdfFileSignature();
pdfSign.BindPdf(pdfFilePath);
if (pdfSign.ContainsSignature(signatureName))
{
if (pdfSign.VerifySignature(signatureName))
{
Console.WriteLine("Signature Verified");
}
else
{
Console.WriteLine("Signature could not be verified.");
}
}
else
{
Console.WriteLine("Signature not found.");
}
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
-
Check for Updates: Since you mentioned the issue persists after upgrading, ensure that you are using the latest version of the Aspose.PDF library. Sometimes, bugs are fixed in newer releases.
-
Review Documentation: For more detailed information on handling signatures, you can refer to the official Aspose documentation or examples related to signature verification.
If the problem continues, consider providing additional details about the error message you are receiving, as this can help in diagnosing the issue further.
Feel free to reach out if you need more assistance!
Sources:
[1]: VerifyValidSignature.cs
[2]: VerifySignature.cs
Dear Sir
It throws error when run the code for binding document as bellow . And i attached the document of PDF for your reference .
CANEC23007987103_1723162018132.pdf (4.0 MB)
PdfFileSignature pdfSign = new PdfFileSignature();
**pdfSign.BindPdf(pdfFilePath);**
@wengyeung
Thank you for reporting about the issue and providing the files
I’ll check this scenario and write you as soon as possible
@wengyeung
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFNET-57955
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
I checked the issue; it seems that something is not correct with the document’s general info.
Even the following code snippet reproduces the issue:
Document document = new Document(InputFolder + “CANEC.pdf”);
Therefore, I have added a task for the development team.
I’ll try to investigate if there’s any workaround, and I’ll contact you in case I find something.