Analyze SignResult result to check newly created signatures if needed.
This example shows how to sign PDF with Digital signature certificate and analyze SignResult
Signaturesignature=newSignature("sample.pdf");DigitalSignOptionsoptions=newDigitalSignOptions("certificate.pfx");// certifiate password
options.setPassword("1234567890");// digital certificate details
options.setReason("Sign");options.setContact("JohnSmith");options.setLocation("Office1");// image as digital certificate appearance on document pages
options.setImageFilePath("sample.jpg");//
options.setAllPages(true);options.setWidth(80);options.setHeight(60);options.setVerticalAlignment(VerticalAlignment.Bottom);options.setHorizontalAlignment(HorizontalAlignment.Right);Paddingpadding=newPadding();padding.setBottom(10);padding.setRight(10);options.setMargin(padding);SignResultsignResult=signature.sign("signed.pdf",options);// analyzing result
System.out.print("List of newly created signatures:");intnumber=1;for(BaseSignaturetemp:signResult.getSucceeded()){System.out.print("Signature #"+number+++": Type: "+temp.getSignatureType()+" Id:"+temp.getSignatureId()+",Location: "+temp.getLeft()+"x"+temp.getTop()+". Size: "+temp.getWidth()+"x"+temp.getHeight());}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online GroupDocs Signature App.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.