Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Feb 08, 2022 2:32 pm

Hey,

i use your solution to add signature fields (and some others fields) on pdf.
And, i use a pdf viewer solution (not yours) to sign with hand on tablet.
After signed, i do some treatments with spire, but i would to know which signature field is signed or always empty but i dont find anything to know that.

Can you help me please ?

Thank you

[email protected]
 
Posts: 3
Joined: Thu Sep 14, 2017 4:31 am

Wed Feb 09, 2022 3:33 am

Hello,

Thank you for your inquiry.
Is the handwritten signature you mentioned similar to the signature using Adobe's tool "Fill & Sign"? If so, the signature in this way actually exists as a picture in the PDF file, and the content structure of the signature field will not be modified, so it is impossible to judge whether the signature field is signed or not. If you signed with a certificate file, like this tutorial:https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/PDF-Protection-Create-Digital-Signature-in -PDF-with-C-VB.NET.html, please use the following code to determine whether the signature field is signed.
Code: Select all
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile(inputFile);
var form = (PdfFormWidget)pdf.Form;
for (int i = 0; i < form.FieldsWidget.Count; ++i)
{
    PdfSignatureFieldWidget field = form.FieldsWidget[i] as PdfSignatureFieldWidget;
    if (field.Signature == null)
    {
        Console.WriteLine(field.Name + " is empty");
    }
    else
    {
        Console.WriteLine(field.Name + " is signed");
    }           
}

If the above methods do not meet your requirements, please provide your signed PDF file for further investigation. You could attach it here or send it to us via email ([email protected]). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF

cron