GroupDocs.Signature for Python 26.1(2026 년 1월)의 새로운 소식

ID 카테고리 요약
SIGNATURENET‑5528 기능 PNG 및 JPG 이미지에 스테가노그래픽 LSB 삽입을 이용한 이미지 디지털 서명 지원 및 검증
SIGNATURENET‑5445 기능 바코드·QR 코드 서명 미리보기의 적응형 렌더링 – 명시적인 가로·세로 크기 제어
SIGNATURENET‑5479 기능 바코드·QR 코드 미리보기 이미지 회전 지원
SIGNATURENET‑5478 기능 이미지 기반 서명을 위한 APNG 및 TGA 이미지 포맷 처리 추가
SIGNATURENET‑5500 향상 서명 검색·검증을 위한 LINQ‑스타일 쿼리 최적화(프레디케이트 필터링)
SIGNATURENET‑5480 향상 바코드·QR 미리보기에 배경 투명도 지원
SIGNATURENET‑5477 향상 배경 색상이 있는 디지털 서명을 위한 오버레이 이미지 지원(전경‑이미지 플래그)
SIGNATURENET‑5422 향상 보안성이 낮은 암호화 알고리즘(RC2, DES, TripleDES 및 약한 AES 모드) 제거
SIGNATURENET‑5555 🐞 버그 수정 Linux 환경에서 DOC 파일의 GeneratePreview() 호출 시 발생하던 타입‑이니셜라이저 예외 해결

아래는 가장 영향력 큰 변경 사항에 대한 간단한 기술 walkthrough입니다.

1. 이미지 디지털 서명(스테가노그래피)

  • 서명은 PNG/JPG 픽셀의 가장 낮은 비트에 숨겨집니다.
  • 비밀번호 보호, 스트림 호환, 크기 ≥ 8 × 8 픽셀인 모든 이미지에서 동작합니다.

이미지 서명하기

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)}")

서명된 이미지 검증하기

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.")

고급 검증(전체 데이터 추출)

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. 바코드·QR 코드 미리보기의 적응형 렌더링

개발자는 이제 widthheight를 정확히 지정하여 미리보기 생성 시 이전의 “자동‑크기” 불일치를 방지할 수 있습니다.

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)

3. 바코드·QR 코드 미리보기 회전 지원

바코드/QR 옵션에 rotation_angle(도) 값을 설정하면 회전된 미리보기를 렌더링할 수 있습니다.

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)

4. 새로운 이미지 포맷 지원 – APNG·TGA

APNG(애니메이션 PNG)와 TGA(타가) 파일을 이제 이미지 서명으로 사용할 수 있으며, 삽입·미리보기·검증이 PNG/JPG와 동일하게 동작합니다.

5. 바코드·QR 미리보기에 배경 투명도 적용

바코드·QR 옵션에 transparency 속성(0 – 1)을 지정하면 투명 캔버스를 가진 미리보기를 생성할 수 있습니다.

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)

6. 디지털 서명을 위한 오버레이 이미지 지원

PdfDigitalSignatureAppearance가 이제 오버레이 이미지와 배경 색상을 동시에 지원하며, 이미지가 텍스트를 가리지 않도록 할 수 있습니다. 레이어 순서는 SignatureCustomAppearance.IsForegroundImage 로 제어합니다.

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}")

7. 보안 강화 – 취약 알고리즘 제거

RC2, DES, TripleDES 및 약한 AES 모드가 암호화 스택에서 제거되었습니다. 이제 최신 NIST‑인증 알고리즘만 제공되어 서명된 문서의 기본 보안 수준이 향상됩니다.

8. LINQ‑스타일 쿼리 최적화

서명 searchverify프레디케이트 함수를 받아 무거운 처리 이전에 서명을 필터링합니다. 이로써 메모리 사용량이 감소하고 배치 작업 속도가 빨라집니다.

프레디케이트를 이용한 검색

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()]

    # "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}")

프레디케이트를 이용한 검증

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

    # 1 페이지에 있는 서명만 검증
    result = signature.verify(verify_options,
        lambda sig: sig.page_number == 1)

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

9. Linux에서 DOC 미리보기 충돌 수정

Linux 환경에서 Microsoft Word(.doc) 파일을 처리할 때 GeneratePreview()TypeInitializerException을 발생시키던 문제가 해결되어, 크로스‑플랫폼 미리보기 기능이 정상 복구되었습니다.


업그레이드 방법

pip install --upgrade groupdocs-signature-net

주의: groupdocs-signature-net 패키지는 .NET 래퍼를 통한 Python 사용을 위한 이름입니다.


참고 자료


앞으로도 새로운 릴리스를 기대해 주세요. 공식 블로그에서 성능 팁과 모범 사례 가이드를 확인하시기 바랍니다.