PDF Render v2

Creates PDF documents from structured content or a JSON document template. Rendering is self-contained and does not require a browser, HTML, CSS, operating-system fonts or external executables.

Revision History

0.0.6.2 - Provides structured PDF rendering and data-bound templates with enhanced document layouts.

Setup Notes

  1. Select a Render template for a report, invoice or another supported layout, or use Render Template for dynamic data binding.
  2. Map document content from your Workflow and choose Standard or Enhanced through SchemaVersion.
  3. Connect the returned Content stream to a file, email or another stream consumer. No Connection is required.

Methods

Render

Validates and renders a structured document.

Parameter Type Description
Document Object Document metadata, page settings and content. Select a template for editable nested fields.
Return Type Description
Content Stream Readable, seekable PDF stream positioned at the beginning. Dispose it when finished.

Render Template

Binds data into a native JSON document template, then validates and renders it.

Parameter Type Description
Template String JSON document containing case-sensitive placeholders such as {{Customer.Name}}.
Data Object Structured values addressed by template placeholders.
Return Type Description
Content Stream Readable, seekable PDF stream positioned at the beginning. Dispose it when finished.

Usage Notes

  • Standard is the default document schema. It supports metadata, page formats and orientation, millimetre margins, text headers and footers, paragraphs, headings, page breaks and tables.
  • Enhanced adds PNG/JPEG images, independently configured sections, rich text, spacers, rules, panels, columns and enhanced table formatting. Older Version1/Version2 and numeric schema selectors remain accepted.
  • Root Blocks and Sections are mutually exclusive. Colors use exact #RRGGBB notation. Physical dimensions use millimetres; font sizes and border weights use points.
  • Supply images as Base64 data or supported Base64 data URIs. Images are never loaded from paths or URLs. PNG/JPEG signatures, pixel dimensions and decoded-size limits are validated.
  • Exact placeholders inject the original JSON value. For example, "{{Rows}}" can inject an array without converting it to text. A placeholder embedded in a longer string must resolve to a scalar.
  • Placeholders use case-sensitive dot paths. Missing paths, invalid values and resource limits produce errors identifying the template or document path.

Examples

Bind a report title

Use this value for Template:

{
  "Info": { "Title": "Report {{ReportNumber}}" },
  "Blocks": [
    { "Type": "Paragraph", "Text": "Prepared for {{Customer.Name}}" }
  ]
}

Supply Data:

{
  "ReportNumber": "R-1001",
  "Customer": { "Name": "Example Company" }
}

For tables and more complex layouts, start with a Render or Render Template sample and map its nested fields.

See also