Here are the key reasons to use the new updated API provided by GroupDocs.Signature for .NET since version 19.8:
Signature class introduced as aΒ single entry pointΒ to sing the document with various signature types with further verification and search with any supported file format.
DocumentΒ signature options (SignOptions), verify options (VerifyOptions) and search options (SearchOptions) were unifiedΒ for all document types. Instead of using document related options now options are related to signature type only.
The overall document related classes were unified to common.
Product architecture was redesigned from scratch in order to simplify passing options and classesΒ to manipulate signature.
Document information and previewΒ generation procedures were simplified.
How To Migrate?
Here is a brief comparison of how to sign document with text signature using old and new API.
Old coding style
// setup Signature configurationSignatureConfigsignConfig=newSignatureConfig{StoragePath=@"c:\Aspose\Test\Storage",OutputPath=@"c:\Aspose\Test\Output"};// instantiating the signature handlerSignatureHandlerhandler=newSignatureHandler(signConfig);// setup text signature optionsPdfSignTextOptionssignOptions=newPdfSignTextOptions("John Smith"){// locate signatureLeft=100,Top=100,Width=100,Height=30,// set Text color and FontForeColor=Color.Red,Font=newSignatureFont{FontSize=12,FontFamily="Comic Sans MS"}};SaveOptionssaveOptions=newSaveOptions{OutputType=OutputType.String,OutputFileName="signed.pdf"};// sign documentstringsignedPath=handler.Sign<string>("test.pdf",signOptions,saveOptions);Console.WriteLine("Signed file path is: "+signedPath);
New coding style
using(Signaturesignature=newSignature("sample.pdf")){TextSignOptionsoptions=newTextSignOptions("John Smith"){// locate signatureLeft=100,Top=100,Width=100,Height=30,// set Text color and FontForeColor=Color.Red,Font=newSignatureFont{Size=12,FamilyName="Comic Sans MS"}};// sign document to filesignature.Sign("signed.pdf",options);}
For more code examples and specific use cases please refer to ourΒ Developer GuideΒ documentation orΒ GitHubΒ samples and showcases.
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.