Boldsign.TextTag (Boldsign v0.9.0)

Copy Markdown View Source

Typed builders for BoldSign text-tag form-field definitions.

BoldSign can place form fields from text tags: put a {{definition_id}} placeholder in the document, then send a matching textTagDefinitions entry (with useTextTags: true) so BoldSign replaces the placeholder with a typed field. This module builds those entries so callers do not have to hand-write the field-type strings ("Signature", "DateSigned", ...) or the payload shape.

Example

pdf # ...contains "{{sign_here}}" and "{{date_here}}"

Boldsign.Document.send(client, %{
  title: "Agreement",
  files: [Boldsign.File.from_binary(pdf, "agreement.pdf", "application/pdf")],
  signers: [%{name: "Ada", emailAddress: "ada@example.com", signerType: "Signer"}],
  useTextTags: true,
  textTagDefinitions: [
    Boldsign.TextTag.signature("sign_here", signer_index: 1),
    Boldsign.TextTag.date_signed("date_here", signer_index: 1)
  ]
})

Each definition_id must appear verbatim in the document as {{definition_id}}.

Summary

Types

Options: :signer_index (1-based, default 1) and :size (%{width:, height:} or {w, h}).

Functions

Builds a definition for any BoldSign field type string. Use the typed helpers above for the common cases; this is the escape hatch for others.

A date-signed field (auto-filled by BoldSign with the signing date).

A signature field anchored at the {{definition_id}} placeholder.

A free-text field the signer fills in.

Types

opts()

@type opts() :: [signer_index: pos_integer(), size: map() | {number(), number()}]

Options: :signer_index (1-based, default 1) and :size (%{width:, height:} or {w, h}).

Functions

build(type, definition_id, opts \\ [])

@spec build(String.t(), String.t() | atom(), opts()) :: map()

Builds a definition for any BoldSign field type string. Use the typed helpers above for the common cases; this is the escape hatch for others.

checkbox(definition_id, opts \\ [])

@spec checkbox(String.t() | atom(), opts()) :: map()

A checkbox field.

date_signed(definition_id, opts \\ [])

@spec date_signed(String.t() | atom(), opts()) :: map()

A date-signed field (auto-filled by BoldSign with the signing date).

initial(definition_id, opts \\ [])

@spec initial(String.t() | atom(), opts()) :: map()

An initials field.

signature(definition_id, opts \\ [])

@spec signature(String.t() | atom(), opts()) :: map()

A signature field anchored at the {{definition_id}} placeholder.

text_box(definition_id, opts \\ [])

@spec text_box(String.t() | atom(), opts()) :: map()

A free-text field the signer fills in.