QrCodeSignOptions class

QrCodeSignOptions class

Represents the QR-Code signature options.

The QrCodeSignOptions type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the QRCodeSignOptions class with default values.
init Initializes a QR code signature options instance with the specified text.
init Initializes a new instance of the QrCodeSignOptions class with text.

Properties

Property Description
code_text_alignment The alignment of text in the resulting QR-code image, default value is None.
data The custom object to serialize to QR-Code content.
data_encryption The data encryption implementation used to encode and decode QR code signature text or data.
encode_type The QR-Code type.
fore_color The foreground color of QR code bars; using this property could cause verification problems, so use it carefully.
height The height of the signature area on the document page in measure units (pixels, percents, or millimeters; see MeasureType SizeMeasureType).
horizontal_alignment The horizontal alignment of the QR code on a document page.
inner_margins The space between QR code elements and result image borders.
left The left X position of the signature area on a document page in measure units (pixels, percents, or millimeters).
location_measure_type The measure type (pixels, percents or millimeters) for left and top properties.
logo_file_path The QR-code logo image file name.
logo_stream The QR-code logo image stream.
margin The space that is specified by default between Image and Document edges (works if horizontal or vertical alignment is specified).
margin_measure_type The margin measurement type (pixels, percents or millimeters).
return_content The flag to retrieve QR-Code image content of a signature placed on a document page.
return_content_type The file type of the returned image content of the QR‑Code signature when the return_content property is enabled.
rotation_angle The rotation angle in degrees, clockwise.
size_measure_type The measure type (pixels, percents or millimeters) for Width and Height properties.
stretch The stretch mode on the document page.
top The top Y position of the signature area on a document page in measure units (pixels, percents, or millimeters). The unit is defined by the LocationMeasureType property of type MeasureType.
transparency The transparency of the QR code signature. The value ranges from 0.0 to 1.0, with a default of 0.
vertical_alignment The vertical alignment of the image on a document page.
width The width of the signature area on the document page in measure values (pixels, percent, or millimeters as defined by MeasureType).
all_pages The signature will be placed on all document pages. (inherited from SignOptions)
appearance The additional signature appearance. (inherited from SignOptions)
background The signature background settings. (inherited from TextSignOptions)
border The border settings. (inherited from TextSignOptions)
document_type The document type of the signature options (DocumentType). (inherited from SignOptions)
extensions The signature extensions. (inherited from SignOptions)
font The font of the signature. (inherited from TextSignOptions)
form_text_field_title The title of the text form field to place the text signature into. Can be used only when signature_implementation is set to TextSignatureImplementation.FORM_FIELD. (inherited from TextSignOptions)
form_text_field_type The type of form field to place the text signature into. This property is applicable only when signature_implementation is set to TextSignatureImplementation.FORM_FIELD (i.e., TextToFormField). The default value is FormTextFieldType.ALL_TEXT_TYPES. (inherited from TextSignOptions)
hash_algorithm The hash algorithm to be used for cryptographic operations. Supported exclusively for digital signatures in PDF files. (inherited from SignOptions)
native The native attribute. (inherited from TextSignOptions)
page_number The document page number for signing. (inherited from SignOptions)
pages_setup The options to specify pages to be signed. (inherited from SignOptions)
shape_position The shape position defines where the shape should be presented in the document layout. Available only for Word documents. (inherited from TextSignOptions)
shape_type The type of shape to put text. (inherited from TextSignOptions)
signature_id The unique ID of the signature, usable in verification options and supported only for PDF documents. (inherited from TextSignOptions)
signature_implementation The type of text signature implementation. (inherited from TextSignOptions)
signature_type The signature type (SignatureType). (inherited from SignOptions)
text The text of the signature. (inherited from TextSignOptions)
text_horizontal_alignment The horizontal alignment of text inside a signature, supported only for Image and Annotation signature implementations (see TextSignatureImplementation SignatureImplementation property). (inherited from TextSignOptions)
text_vertical_alignment The vertical alignment of text inside a signature. (inherited from TextSignOptions)
zorder The Z-order position of the text signature, which determines the display order of overlapping signatures. (inherited from SignOptions)

Example

from groupdocs.signature import Signature
from groupdocs.signature.options import QrCodeSignOptions
from groupdocs.signature.domain import (
    Background, Border, DashStyle, HorizontalAlignment, Padding,
    QrCodeTypes, VerticalAlignment)
from groupdocs.pydrawing import Color

def sign_with_qr_code_signature_advanced():
    with Signature("sample.pdf") as signature:
        # Pass the text and the QR code type to the constructor
        options = QrCodeSignOptions("https://www.example.com/verify-document", QrCodeTypes.QR)

        # Put the QR code in the bottom right corner of the page
        options.width = 120
        options.height = 120
        options.horizontal_alignment = HorizontalAlignment.RIGHT
        options.vertical_alignment = VerticalAlignment.BOTTOM
        options.margin = Padding(right=40, bottom=60)

        # Module color, background, and a dotted border with some space inside
        options.fore_color = Color.dark_blue
        background = Background()
        background.color = Color.light_yellow
        options.background = background
        border = Border()
        border.color = Color.dark_blue
        border.dash_style = DashStyle.DOT
        border.weight = 2
        border.visible = True

        signature.sign("signed.pdf", options)

Guides

Task guides that use QrCodeSignOptions:

See Also