Native PDF engine

What it is

From version 9.0.0, 3B can generate the final Document.pdf inside your Salesforce org, using Salesforce's built-in PDF renderer, instead of sending the document's render page to the external rendering service. This is called the native PDF engine.

Benefits of the native engine:

The external rendering service remains supported. NativeWithFallback provides automatic fallback after a native render failure. In version 10.0.0, new Templates and Sign Documents default to a Native record-level override. General Settings continues to default to NativeWithFallback.

Choosing the engine

The PDF Engine field on a Template or Sign Document takes precedence over General Settings. A Template override applies to its Document Traces and Redline Requests; a Document override applies to its Submission Requests. The same selection applies to manual and bulk regeneration.

New Template and Document records default to Native in version 10.0.0. Existing records are not backfilled by this default. Clear the record-level field to inherit General Settings, or select the external PDF service (picklist value Heroku) or Native with Fallback explicitly. A blank record override means inheritance, not external-only rendering.

The resolved engine behaves as follows:

Value Behavior
blank General Settings or Heroku All PDFs are generated by the external rendering service, exactly as in previous versions.
NativeWithFallback General Settings default. New documents render in-org; if the native render fails or the artifact cannot be rendered natively, the document is sent to the external rendering service automatically.
Native Eligible artifacts render in-org. A native render failure is logged without retrying externally. Missing or oversized artifacts still route to the external service.

Because General Settings is a hierarchy custom setting, you can enable the native engine for a single user or profile first (for example your admin team) and roll it out org-wide once you are happy with the output. For records that inherit General Settings, switching that setting to Heroku routes subsequent generation externally. Explicit Template or Document overrides continue to take precedence. No deployment is needed in either direction.

How native generation works

  1. A document is signed or completed (a Templates document is signed, a Sign submitter signs, a collaborator signs their part of a redlined document, or a redline is completed). Generation runs after every individual signature, not only when the document is fully complete, so the stored PDF always reflects the signatures collected so far.
  2. Before each signature is recorded, the signing app saves a print-optimized copy of the document (DocumentPdf.html, plus a DocumentPdf.json manifest and any extracted images) on the tracking record, alongside the existing Document.html.
  3. A trigger on the tracking record detects the signature (or completion) and publishes a PDF Generation Request platform event. When several signatures land in the same transaction, only one event is published per record.
  4. The platform event is processed in an internal automated context, never as the guest signer. The processor renders the print-optimized copy with Salesforce's built-in renderer and stores the result as Document.pdf on the same record, exactly where the external service would have put it.
  5. The PDF audit fields on the record are stamped (see below).
  6. The print-optimized copy, its manifest and any extracted images are deleted from the record to reclaim file storage. They are only inputs to PDF generation and are rebuilt automatically before the next signature. The same cleanup runs when a completed PDF arrives from the external rendering service. The Document.pdf itself and the original Document.html are always kept, and a cleanup problem never affects the generated PDF.

Documents completed before the native engine was enabled do not have the print-optimized copy, so they are always routed to the external rendering service. This includes manual regeneration of older documents.

The PDF audit fields

Every successful generation stamps these fields on the tracking record (Document Trace for Templates, Submission Request for Sign, Redline Request for redlining):

Field Contents
PDF Content Version Id The ContentVersion id of the generated Document.pdf.
PDF Content Document Id The ContentDocument id of the generated Document.pdf.
PDF Generated At When the PDF was stored.
PDF Engine Used Native or Heroku.

Both engines stamp these fields. They give you:

File name and versioning

From version 10.11.0, both engines store completed PDFs as Document.pdf for Templates, 3B Sign and Redlining. Previously, the native engine named Sign PDFs after the Sign Document. The signing page still gives the downloaded copy the Sign Document's name.

Native regeneration reuses the file referenced by PDF Content Document Id when it is valid and still linked to the tracking record. External regeneration attempts to align that file's title so the service can reuse it too. When the file is reused, generation adds a ContentVersion, retaining its ContentDocument Id while updating PDF Content Version Id, PDF Generated At and PDF Engine Used. This fixes engine switches creating a separate Sign PDF because the two engines used different file names.

Situation Behaviour
Native regeneration with a valid linked PDF reference Adds a version to the referenced file regardless of its previous title. Standard generation titles the new version Document.pdf.
External regeneration with a valid linked PDF reference Attempts to retitle that file Document.pdf so the external service can find and version it.
Missing, invalid or unlinked PDF reference The stored reference cannot be reused. Native generation falls back to matching the file title, or creates a new file if none matches.
A different Document.pdf already exists on the record External title alignment leaves the files unchanged to avoid an ambiguous target. Existing duplicates are not merged automatically.

External title alignment is best effort. A failure is logged as a PDF Engine error and does not cancel the generation request, so the same ContentDocument Id cannot be guaranteed when alignment fails or a duplicate already exists.

Before changing engines on an older record

Check PDF Content Document Id and the record's Files list. An older Sign PDF named after the Document can be retitled during regeneration. If another Document.pdf is already linked, have an administrator review the duplicate files before relying on the same file reference across engines. Preserve delivered signed PDFs and their evidence; do not assume an upgrade merges or repairs existing files.

After regeneration, check the four PDF audit fields to confirm the new version and engine. Regenerating without a pending unhashed signature audit does not replace stored signature hashes. See E-signature attestation and document validation.

Differences you may notice in native output

The native engine uses Salesforce's built-in renderer, which is not a full web browser. Output is close to the external service for most documents, but there are known differences:

If a Template depends on styling the native engine cannot reproduce, set its PDF Engine to the external PDF service (picklist value Heroku). NativeWithFallback retries render failures; it does not detect visual differences in a successfully generated PDF.

Failure handling

Monitor adoption with a report on Log Entry records of type PDF Engine, plus the PDF Engine Used field on your tracking records.

Headers and footers

Templates can include repeating headers and footers in the native PDF's top and bottom margins, with an optional different first page. These also appear on audit trail pages. Size the content to its margin and review the generated output. See Headers and footers.