A stamp signature is a special type of electronic signature that has the visual appearance of a round seal and its visual parameters can be set programmatically.
Every stamp signature can have multiple “stamp lines” with custom text and different line thicknesses, colors, font weights and sizes. Here is an example of how a stamp signature created with GroupDocs.Signature for Python via .NET may look like:
GroupDocs.Signature provides the StampSignOptions class to specify different options for Stamp signature:
Stamp type - Round or Square;
Height and width in pixels;
Alignment and position within the document page;
and many more.
Each Stamp option contains inner and outer lines. Inner lines represent vertical lines inside the stamp, while outer lines represent circles (or rectangles based on stamp type) around the stamp with their own text, border settings, background etc.
Here are the steps to add a Stamp signature to a document with GroupDocs.Signature:
Create a new instance of the Signature class and pass the source document path as a constructor parameter.
Instantiate the StampSignOptions object according to your requirements and specify appropriate options.
This example shows how to add a Stamp signature to a document using Python:
importgroupdocs.signatureassignaturefromgroupdocs.signature.optionsimportStampSignOptionsfromgroupdocs.signature.domainimportStampLineimportgroupdocs.signature.domainasgsdimportsysimportosdefrun():withsignature.Signature("./sample.docx")assign:# Create stamp signature optionsoptions=StampSignOptions()# Set stamp signature positionoptions.left=100options.top=100# Setup first external line of Stampouter_line=StampLine()outer_line.text=" * European Union * European Union * European Union *"outer_line.font.font_size=12outer_line.height=22outer_line.text_bottom_intent=6outer_line.text_color=gsd.Color.WHITE_SMOKEouter_line.background_color=gsd.Color.DARK_SLATE_BLUEoptions.outer_lines.add(outer_line)# Inner square lines - horizontal lines inside the ringsinner_line=StampLine()inner_line.text="John"inner_line.text_color=gsd.Color.MEDIUM_VIOLET_REDinner_line.font.font_size=20inner_line.font.bold=Trueinner_line.height=40options.inner_lines.add(inner_line)# Sign documentsign.sign("./SampleSigned.docx",options)### Advanced Stamp Signature OptionsHere's an example showing how to create a more complex stamp signature with multiple lines and custom styling:```pythonimportgroupdocs.signatureassignaturefromgroupdocs.signature.optionsimportStampSignOptionsfromgroupdocs.signature.domainimportStampLineimportgroupdocs.signature.domainasgsdimportsysimportosdefrun():withsignature.Signature("./sample.docx")assign:# Create stamp signature optionsoptions=StampSignOptions()# Set stamp signature position and sizeoptions.left=100options.top=100options.width=200options.height=200# Set stamp type (Round or Square)options.stamp_type=gsd.StampType.ROUND# Setup outer linesouter_line1=StampLine()outer_line1.text=" * APPROVED * "outer_line1.font.font_size=14outer_line1.font.bold=Trueouter_line1.height=30outer_line1.text_color=gsd.Color.WHITEouter_line1.background_color=gsd.Color.DARK_BLUEoptions.outer_lines.add(outer_line1)outer_line2=StampLine()outer_line2.text=" * 2024 * "outer_line2.font.font_size=12outer_line2.height=25outer_line2.text_color=gsd.Color.WHITEouter_line2.background_color=gsd.Color.DARK_BLUEoptions.outer_lines.add(outer_line2)# Setup inner linesinner_line1=StampLine()inner_line1.text="John Smith"inner_line1.font.font_size=20inner_line1.font.bold=Trueinner_line1.height=40inner_line1.text_color=gsd.Color.DARK_BLUEoptions.inner_lines.add(inner_line1)inner_line2=StampLine()inner_line2.text="CEO"inner_line2.font.font_size=16inner_line2.height=30inner_line2.text_color=gsd.Color.DARK_BLUEoptions.inner_lines.add(inner_line2)# Sign documentsign.sign("./SampleSigned.docx",options)
Summary
This guide explains how to apply stamp-based signatures to documents using GroupDocs.Signature for Python via .NET. It covers the process of creating a stamp signature, customizing its appearance, and positioning it on the document. The signed document can then be saved with the stamp signature applied.
More Resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: