This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/python/editor/add-visible-signature-to-pdf.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Adding visible digital signatures to a PDF document | Nutrient Python SDK

Use visible digital signatures to combine visual signoff with cryptographic integrity.

Common use cases include:

  • Contract signing workflows
  • Document approval systems
  • Authenticated signoff pipelines
  • Branded signature appearances

Unlike invisible signatures, visible signatures render a signature area on the page using text or images.

Download sample

How Nutrient helps

Nutrient Python SDK handles signature field operations, appearance rendering, and cryptographic signing.

The SDK handles:

  • Signature field dictionaries and appearance streams
  • PKCS#12 certificate loading and key extraction
  • Appearance customization and font rendering
  • Byte range calculations and signing internals

Complete implementation

This example adds a visible signature field and signs it with different appearance options:

from contextlib import ExitStack
from nutrient_sdk import Document, PdfEditor, Signature, Color
from nutrient_sdk import DigitalSignatureOptions, SignatureAppearance, TimestampConfiguration
from nutrient_sdk import SignatureHashAlgorithm

Creating a signature field

Create a signature field at the target location before signing.

In this sample:

The field acts as the visible placeholder for the signed appearance. An ExitStack collects the editor and its page and collection wrappers for cleanup:

with Document.open("input.pdf") as document, ExitStack() as resources:
editor = resources.enter_context(PdfEditor.edit(document))
pages = resources.enter_context(editor.page_collection)
page = resources.enter_context(pages.first)
form_fields = resources.enter_context(editor.form_field_collection)
signature_field = form_fields.add_signature_field(
name="ApprovalSignature",
page=page,
x=100.0,
y=700.0,
width=200.0,
height=50.0
)
editor.save_as("output_document_with_field.pdf")
resources.close()

The sample registers its page and collection wrappers with the resource stack. Calling resources.close() disposes them in reverse creation order before disposing the editor. The stack also ensures cleanup if an earlier operation raises an exception.

Signing with auto-generated appearance

Sign the field with metadata-driven text.

In this sample:

  • DigitalSignatureOptions sets certificate and signer metadata.
  • Document.open("output_document_with_field.pdf") opens the PDF before signing.
  • use_auto_generated_text = True uses signer metadata in the appearance.
  • show_validation_mark = True adds a validation indicator.
  • sign_field(document, output_path, field_name, options, appearance) signs "ApprovalSignature".
with Signature() as signer, Document.open("output_document_with_field.pdf") as document:
options = DigitalSignatureOptions()
options.certificate_path = "certificate.pfx"
options.certificate_password = "Nutrient answers all your document needs"
options.signer_name = "John Doe"
options.reason = "Final Approval"
options.location = "New York"
appearance = SignatureAppearance()
appearance.use_auto_generated_text = True
appearance.show_validation_mark = True
signer.sign_field(
document,
"output_signed_visible.pdf",
"ApprovalSignature",
options,
appearance
)

Signing with a custom image

Use an image-based appearance for handwritten signatures or logos.

In this sample:

  • Document.open("output_document_with_field.pdf") opens the PDF before signing.
  • image_path points to the signature image file.
  • The image renders inside field bounds.
  • show_validation_mark = True keeps the validation indicator visible.
  • sign_field(document, output_path, field_name, options, appearance) applies the digital signature.
with Signature() as signer, Document.open("output_document_with_field.pdf") as document:
options = DigitalSignatureOptions()
options.certificate_path = "certificate.pfx"
options.certificate_password = "Nutrient answers all your document needs"
options.signer_name = "Jane Smith"
options.reason = "Review Complete"
appearance = SignatureAppearance()
appearance.image_path = "input_signature.jpg"
appearance.show_validation_mark = True
signer.sign_field(
document,
"output_signed_with_image.pdf",
"ApprovalSignature",
options,
appearance
)

Signing with custom text

Use custom text when you need workflow-specific signature content.

In this sample:

  • Document.open("output_document_with_field.pdf") opens the PDF before signing.
  • use_auto_generated_text = False disables metadata-generated text.
  • text defines the visible signature content.
  • \n creates multiline output.
  • sign_field(document, output_path, field_name, options, appearance) applies the digital signature.
with Signature() as signer, Document.open("output_document_with_field.pdf") as document:
options = DigitalSignatureOptions()
options.certificate_path = "certificate.pfx"
options.certificate_password = "Nutrient answers all your document needs"
options.signer_name = "Manager"
appearance = SignatureAppearance()
appearance.use_auto_generated_text = False
appearance.text = "Approved by Management\nDate: 2024-01-15"
signer.sign_field(
document,
"output_signed_custom_text.pdf",
"ApprovalSignature",
options,
appearance
)

Customizing text appearance

Customize typography to match document or brand requirements.

In this sample:

  • Document.open("output_document_with_field.pdf") opens the PDF before signing.
  • font_name sets the typeface.
  • font_size sets text size.
  • text_color sets ARGB color values.
  • sign_field(document, output_path, field_name, options, appearance) applies the digital signature.
with Signature() as signer, Document.open("output_document_with_field.pdf") as document:
options = DigitalSignatureOptions()
options.certificate_path = "certificate.pfx"
options.certificate_password = "Nutrient answers all your document needs"
options.signer_name = "Executive"
appearance = SignatureAppearance()
appearance.use_auto_generated_text = False
appearance.text = "Approved by Executive Board"
appearance.font_name = "Times New Roman"
appearance.font_size = 14.0
appearance.text_color = Color.from_argb(255, 0, 0, 128) # Navy blue
signer.sign_field(
document,
"output_signed_styled_text.pdf",
"ApprovalSignature",
options,
appearance
)

Conclusion

Use this workflow to add visible digital signatures:

  1. Open the document using a context manager(opens in a new tab) for automatic resource cleanup.
  2. Create an editor and access the page collection.
  3. Add a signature field at specified coordinates with defined dimensions (e.g. 100, 700, 200×50 points).
  4. The signature field creates a rectangular placeholder for the signature appearance.
  5. Sign the field using Signature with certificate credentials (PKCS#12 format).
  6. Configure signing metadata, including signer name, reason, and location.
  7. Create the signature appearance with auto-generated text (use_auto_generated_text = True) to display metadata.
  8. Add validation marks (show_validation_mark = True) to indicate signature validity.
  9. Use custom images via the image_path property for handwritten signatures or company logos.
  10. Use custom text with use_auto_generated_text = False and multiline formatting for workflow-specific approvals.
  11. Customize typography with font_name, font_size, and text_color properties using ARGB values.
  12. Save the signed document with visible signature appearance and cryptographic integrity.

For related signing workflows, refer to the Python SDK guides.