Skip to content
Last updated

Signature image configuration overview

SignBox allows placing a visual signature inside the signed PDF document. The visual signature combines an optional image with customizable text that displays signer information from the certificate.

Use the signature_appearance parameter to define how the signature will look. You can also target specific PDF form fields using signature_ids.

Request parameters

ParameterDescriptionExample
signature_appearanceJSON object that describes the visual appearance of the signature.See Signature appearance object below
signature_idsComma-separated list of PDF signature field IDs to sign. Use this when your PDF contains pre-defined signature form fields.signature1,signature2

Signature appearance object

The signature_appearance object controls text content, positioning, images, date formatting, and layout. All properties are optional; configure only what you need.

Complete configuration example

{
  "text": [
    "Signed by: %(CN)s",
    "%(EMAIL)s %(L)s %(SUBJECT)s",
    "Date: %(DATE)s"
  ],
  "date": "%d/%m/%Y %H:%M:%S %z",
  "timezone": "America/Guatemala",
  "position": "30,100,165,150",
  "image": "be1cd133-8be5-4346-87de-d40afd90a3b9",
  "horizontal": true,
  "page": 0
}

Parameter reference

ParameterDescription
textArray of text lines to display. Use variables to retrieve data from the signer certificate. Each array element is a separate line.
dateDate format string. Supports strftime-style placeholders (e.g. %d/%m/%Y %H:%M:%S).
timezoneTimezone for the signature date. Default is UTC. List available timezones with: timedatectl list-timezones
positionCoordinates in points (pt) for signature placement and size: x1,y1,x2,y2. Origin is bottom-left of the page. 1px = 0.75pt.
imageID of a previously uploaded image to use as the signature graphic.
b64_imageImage encoded in base64. Use this instead of image when you do not pre-upload the image.
qrcodeURL used to generate a QR code in the signature block.
horizontalBoolean. When true, arranges image and text horizontally.
pageZero-based page index where the signature will be placed. First page is 0.
text_sizeFont size for the signature text.
text_alignHorizontal alignment of the text (left, center, or right).
reasonHuman-readable reason for signing (e.g. "Contract approval").
locationGeographic location associated with the signature.

Position coordinate system

The position parameter defines a rectangle using four values: x1,y1,x2,y2.

  • Origin: Bottom-left corner of the page (0,0)
  • x1, y1: Bottom-left corner of the signature area
  • x2, y2: Top-right corner of the signature area
  • Unit: Points (pt). Convert from pixels: 1px = 0.75pt

SignBox signature position coordinate system showing x1,y1,x2,y2 from bottom-left origin

Example: "position": "30,100,165,150" places a signature 30pt from the left, 100pt from the bottom, with a width of 135pt and height of 50pt.

Available text variables

Use these placeholders in the text array to insert certificate and signature data dynamically.

VariableDescription
%(CN)sCommon Name from the signer certificate
%(L)sLocality
%(S)sState or Province Name
%(OU)sOrganizational Unit Name
%(E)sEmail address
%(EMAIL)sEmail from Subject Alternative Name
%(SUBJECT)sFull certificate subject
%(Issuer)sCertificate issuer (CA) Common Name
%(DATE)sSignature date and time (formatted according to date and timezone)
%(date)sSignature date and time in ISO 8601 format

Example text block:

"text": [
  "Signed by: %(CN)s",
  "%(EMAIL)s",
  "Date: %(DATE)s"
]

Image and QR code options

You can include graphics in the visual signature in three ways:

  1. Pre-uploaded image (image): Upload the image via the SignBox API first and reference it by ID.
  2. Inline base64 (b64_image): Provide the image data directly as a base64 string.
  3. QR code (qrcode): Provide a URL; SignBox generates a QR code linking to that URL.