Was ist neu in GroupDocs.Signature für Python 26.1 (Januar 2026)

ID Kategorie Zusammenfassung
SIGNATURENET‑5528 Funktion Unterstützung und Validierung von Bild‑Digitalunterschriften (steganografische LSB‑Einbettung für PNG‑ und JPG‑Dateien).
SIGNATURENET‑5445 Funktion Adaptives Rendering für Barcode‑ und QR‑Code‑Unterschriftsvorschauen – explizite Breiten‑/Höhensteuerung.
SIGNATURENET‑5479 Funktion Rotationsunterstützung für Barcode‑ und QR‑Code‑Vorschau‑Bilder.
SIGNATURENET‑5478 Funktion Unterstützung für die Bildformate APNG und TGA bei bildbasierten Unterschriften hinzugefügt.
SIGNATURENET‑5500 Verbesserung LINQ‑ähnliche Abfrageoptimierung für Unterschriftensuche & ‑­verifizierung (Prädikat‑Filterung).
SIGNATURENET‑5480 Verbesserung Unterstützung für Hintergrund‑Transparenz bei Barcode‑/QR‑Vorschauen.
SIGNATURENET‑5477 Verbesserung Unterstützung für Overlay‑Bilder bei digitalen Unterschriften mit Hintergrundfarbe (foreground‑image‑Flag).
SIGNATURENET‑5422 Verbesserung Entfernung unsicherer Verschlüsselungsalgorithmen (RC2, DES, TripleDES und schwacher AES‑Modi).
SIGNATURENET‑5555 🐞 Fehlerbehebung Behoben: GeneratePreview() Type‑Initializer‑Ausnahme für DOC‑Dateien unter Linux.

Im Folgenden ein kurzer technischer Durchlauf der wirkungsvollsten Änderungen.

1. Bild‑Digitale Unterschrift (Steganographie)

  • Unterschriften werden in den am wenigsten signifikanten Bits von PNG/JPG‑Pixeln versteckt.
  • Passwortgeschützt, stromkompatibel und funktioniert mit jeder Bildgröße ≥ 8 × 8 px.

Signing an image

import groupdocs.signature as gs
import groupdocs.signature.options as gso

input_file  = "image.png"
output_file = "signed_image.png"
password    = "MySecurePassword123"

# Sign the image
with gs.Signature(input_file) as signature:
    sign_options = gso.ImageDigitalSignOptions()
    sign_options.password = password

    sign_result = signature.sign(output_file, sign_options)

    if sign_result.succeeded and len(sign_result.succeeded) > 0:
        print("Image signed successfully!")
        print(f"Signatures added: {len(sign_result.succeeded)}")

Verifying a signed image

import groupdocs.signature as gs
import groupdocs.signature.options as gso

signed_file = "signed_image.png"
password    = "MySecurePassword123"

with gs.Signature(signed_file) as signature:
    verify_options = gso.ImageDigitalVerifyOptions()
    verify_options.password = password
    verify_options.detection_threshold_percent = 75  # optional 0‑100%

    verify_result = signature.verify(verify_options)

    if verify_result.is_valid:
        print("Digital signature is valid!")
        print(f"Verified signatures: {len(verify_result.succeeded)}")
    else:
        print("Digital signature is invalid or not found.")

Advanced validation (full data extraction)

with gs.Signature("signed_image.png") as signature:
    verify_options = gso.ImageDigitalVerifyOptions()
    verify_options.password = "MySecurePassword123"
    verify_options.use_full_data_extraction = True
    verify_options.detection_threshold_percent = 85

    verify_result = signature.verify(verify_options)

    if verify_result.is_valid and verify_options.detected_probability is not None:
        print(f"Signature detected with {verify_options.detected_probability}% probability")

2. Adaptives Rendering für Barcode‑ & QR‑Code‑Vorschauen

Entwickler können nun exakt width und height für die Vorschauerstellung angeben, wodurch die vorherigen „Auto‑Size“‑Inkonsistenzen entfallen.

import groupdocs.signature as gs
import groupdocs.signature.options as gso
import uuid

# QR code options
qr_sign_options = gso.QrCodeSignOptions("GROUP DOCS", gs.QrCodeTypes.QR)
qr_sign_options.width  = 250
qr_sign_options.height = 270
qr_sign_options.fore_color = gs.Color.red
qr_sign_options.code_text_alignment = gs.CodeTextAlignment.BELOW
qr_sign_options.text = "GROUP DOCS"

# Preview generation
preview_options = gso.PreviewSignatureOptions(
    qr_sign_options,
    create_signature_stream,   # user‑provided delegate
    release_signature_stream   # user‑provided delegate
)
preview_options.signature_id   = str(uuid.uuid4())
preview_options.preview_format = gso.PreviewSignatureOptions.PreviewFormats.PNG

gs.Signature.generate_signature_preview(preview_options)

Adaptives QR‑Vorschau

3. Rotationsunterstützung für Barcode‑ & QR‑Vorschauen

Setze rotation_angle (Grad) in den Barcode‑/QR‑Optionen, um rotierte Vorschauen zu rendern.

import groupdocs.signature as gs
import groupdocs.signature.options as gso
import uuid

barcode_sign_options = gso.BarcodeSignOptions("GROUP DOCS", gs.BarcodeTypes.MaxiCode)
barcode_sign_options.width          = 400
barcode_sign_options.height         = 400
barcode_sign_options.fore_color     = gs.Color.red
barcode_sign_options.code_text_alignment = gs.CodeTextAlignment.BELOW
barcode_sign_options.text           = "GROUP DOCS"
barcode_sign_options.rotation_angle = 45   # rotate 45°

preview_options = gso.PreviewSignatureOptions(
    barcode_sign_options,
    create_signature_stream,
    release_signature_stream
)
preview_options.signature_id   = str(uuid.uuid4())
preview_options.preview_format = gso.PreviewSignatureOptions.PreviewFormats.PNG

gs.Signature.generate_signature_preview(preview_options)

Rotierter Barcode

4. Unterstützung neuer Bildformate – APNG & TGA

APNG (animiertes PNG) und TGA (Targa) können nun als Bild‑Unterschriften verwendet, eingefügt, angezeigt und genau wie PNG/JPG verifiziert werden.

5. Hintergrund‑Transparenz für Barcode‑/QR‑Vorschauen

Setze die Eigenschaft transparency (0 – 1) in den Barcode‑/QR‑Optionen, um Vorschauen mit transparentem Canvas zu erzeugen.

barcode_sign_options = gso.BarcodeSignOptions("GROUP DOCS", gs.BarcodeTypes.Codabar)
barcode_sign_options.width  = 400
barcode_sign_options.height = 400
barcode_sign_options.fore_color = gs.Color.red
barcode_sign_options.code_text_alignment = gs.CodeTextAlignment.BELOW
barcode_sign_options.text = "GROUP DOCS"
barcode_sign_options.transparency = 0.5   # 50 % transparent background

preview_options = gso.PreviewSignatureOptions(
    barcode_sign_options,
    create_signature_stream,
    release_signature_stream
)
preview_options.signature_id = str(uuid.uuid4())
preview_options.preview_format = gso.PreviewSignatureOptions.PreviewFormats.PNG

gs.Signature.generate_signature_preview(preview_options)

Transparenter Barcode

6. Unterstützung für Overlay‑Bilder bei digitalen Unterschriften

PdfDigitalSignatureAppearance berücksichtigt jetzt ein Overlay‑Bild und eine Hintergrundfarbe, ohne das Bild zu überdecken. Die Schichtung wird über SignatureCustomAppearance.IsForegroundImage gesteuert.

import groupdocs.signature as gs
import groupdocs.signature.options as gso

signature_image_path = "signature.png"
certificate_path      = "JohnSmithCertificate.pfx"

input_pdf  = "SampleDocument.pdf"
output_pdf = "SignedDocument.pdf"

with gs.Signature(input_pdf) as signature:
    sign_options = gso.DigitalSignOptions(certificate_path)
    sign_options.password = "1234567890"
    sign_options.reason   = "Document approval"
    sign_options.contact  = "John Smith"
    sign_options.location = "Head Office"

    # Visible signature placement
    sign_options.visible = True
    sign_options.left    = 350
    sign_options.top     = 100
    sign_options.width   = 200
    sign_options.height  = 70
    sign_options.image_file_path = signature_image_path

    appearance = gso.PdfDigitalSignatureAppearance()
    appearance.foreground = gs.Color.from_argb(50, gs.Color.brown)
    appearance.font_family_name = "Times New Roman"
    appearance.font_size = 12
    appearance.background = gs.Color.from_argb(50, gs.Color.light_gray)
    appearance.is_foreground_image = True   # image on top of text

    sign_options.appearance = appearance

    sign_result = signature.sign(output_pdf, sign_options)

    print(f"\nDocument signed successfully with {len(sign_result.succeeded)} signature(s).")
    print(f"Signed file saved at: {output_pdf}")

Overlay‑Bild

7. Sicherheits‑Härtung – Entfernung unsicherer Algorithmen

RC2, DES, TripleDES und schwache AES‑Modi wurden aus dem kryptografischen Stack entfernt. Nur moderne, von NIST‑genehmigte Algorithmen stehen zur Verfügung, wodurch die Standardsicherheitslage signierter Dokumente verbessert wird.

8. LINQ‑ähnliche Abfrageoptimierung

Unterschrift‑search und verify akzeptieren nun Prädikat‑Funktionen, die Unterschriften vor den rechenintensiven Verarbeitungsschritten filtern. Das reduziert den Speicherverbrauch und beschleunigt Batch‑Operationen.

Suche mit einem Prädikat

import groupdocs.signature as gs
import groupdocs.signature.options as gso
import groupdocs.signature.domain as gsd

with gs.Signature("document.pdf") as signature:
    search_options = [gso.TextSearchOptions()]

    # Keep only text signatures that contain the word "Approved"
    result = signature.search(search_options,
        lambda sig: isinstance(sig, gsd.TextSignature) and "Approved" in sig.text)

    for sig in result.signatures:
        print(f"Found: {sig.text}")

Verifizierung mit einem Prädikat

with gs.Signature("signed_document.pdf") as signature:
    verify_options = gso.TextVerifyOptions("John Smith")

    # Verify only signatures on page 1
    result = signature.verify(verify_options,
        lambda sig: sig.page_number == 1)

    print(f"Found {len(result)} verified signatures on page 1")

9. Fehler behoben: Linux‑DOC‑Vorschau‑Absturz

GeneratePreview() wirft beim Verarbeiten von Microsoft‑Word‑(.doc)-Dateien unter Linux nicht mehr eine TypeInitializerException, wodurch die plattformübergreifende Vorschaufunktion wiederhergestellt wird.

Upgrade‑Anleitung

pip install --upgrade groupdocs-signature-net

Hinweis: Der Paketname groupdocs-signature-net wird für den Python‑via‑.NET‑Wrapper verwendet.

Ressourcen

Bleiben Sie dran für kommende Releases und behalten Sie den offiziellen Blog für Performance‑Tipps und Best‑Practice‑Leitfäden im Auge.