Electronic Signature is an abstract concept that means data in electronic form associated with a certain document and expressing the consent of the signatory with the information contained in the document.
GroupDocs.Signature provides various electronic signature implementations as follows:
Native text signatures as text stamps, text labels, annotation, stickers, watermarks with big amount of settings for visualization effects, opacity, colors, fonts, etc.;
Text as image signatures with big scope of additional options to specify how text will look, colors, and extra image effects;
Image signatures with options to specify extra image effects, rotation etc.;
Digital signatures based on digital certificate files and ability to support digital signature by document type (PDF, Microsoft Word documents and Microsoft Excel spreadsheets);
Barcode/QR-code signatures with variety of options;
Generated stamp looking image signatures based on predefined lines with custom text, colors, width, etc;
Metadata signatures to keep hidden signatures inside the document;
Form-field signatures.
Signing documents in Python with our electronic signature (eSign) API is easy, reliable and secure. Here’s a simple example of how to add a text signature:
importgroupdocs.signatureassignature# Initialize signature handlersignature_handler=signature.Signature("sample.pdf")# Create text signature optionstext_options=signature.TextSignOptions("John Smith")text_options.set_left(100)text_options.set_top(100)# Sign document with text signaturesignature_handler.sign("output.pdf",text_options)
Search for signatures
Obtain signatures list applied to document:
Text signatures information from all supported formats;
Image signatures information;
Digital signatures information from PDF, Microsoft Word documents and Microsoft Excel spreadsheets;
Barcode/QR-code signatures information from all supported formats;
Metadata signatures information from all supported formats;
Form-field signatures information from all supported formats.
Example of searching for signatures:
importgroupdocs.signatureassignature# Initialize signature handlersignature_handler=signature.Signature("signed.pdf")# Search for text signaturestext_signatures=signature_handler.search(signature.TextSearchOptions())fortext_signatureintext_signatures:print(f"Found text signature: {text_signature.text}")
Verify signatures
Determine whether document contains signatures that meet the specified criteria.
Supported signature types are:
Text signatures;
Digital signatures;
Barcode/QR-code signatures;
Metadata signatures;
Form-field signatures.
Example of verifying signatures:
importgroupdocs.signatureassignature# Initialize signature handlersignature_handler=signature.Signature("signed.pdf")# Verify digital signaturesverify_options=signature.DigitalVerifyOptions("certificate.pfx","password")verify_result=signature_handler.verify(verify_options)print(f"Verification result: {verify_result.is_valid}")
Document information extraction
GroupDocs.Signature allows to obtain basic information about source document - file type, size, pages count, page height and width etc. This may be quite useful for generating document preview and precise signature placing inside document.
Document preview feature allows to generate image representations of document pages. This may be helpful for better understanding about document content and its structure, set proper signature position inside document, apply appropriate signature styling etc. Preview can be generated for all document pages (by default) or for specific page numbers or page range.
Supported image formats for document preview are:
PNG;
JPG;
BMP.
Example of generating document preview:
importgroupdocs.signatureassignature# Initialize signature handlersignature_handler=signature.Signature("sample.pdf")# Create preview optionspreview_options=signature.PreviewOptions(lambdapage_number:f"preview_{page_number}.png")preview_options.set_page_numbers([1,2])# Generate preview for pages 1 and 2# Generate previewsignature_handler.generate_preview(preview_options)
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.