Help Center Document Generation Document Output Formats

Salesforce Document Output Formats: PDF and HTML with Dochly

Updated June 2026 7 min read Document Generation
Dochly generates documents in two formats — PDF and HTML. Each format suits different use cases, audiences, and downstream workflows. Choosing the wrong format is one of the most common setup mistakes — this guide covers exactly when to use each format, what format-specific settings are available, and how to configure format defaults at both the org and template level.

Format overview

Dochly supports two output formats. The right choice depends primarily on what happens to the document after generation — who receives it and what they need to do with it.

When format matters most

Format choice matters most when documents are delivered to external recipients (customers, partners, regulators) or when they need to be edited after generation. Internal documents that stay on the Salesforce record are less format-sensitive.

Where to configure format

Set the default format in Dochly → Settings → General. Override per template in the template settings, or per generation in the generation modal. Template-level overrides the org default; generation-level overrides the template default.


PDF — Portable Document Format

PDF

PDF (.pdf)

Fixed-layout document — renders identically on every device and operating system

Recommended for most uses
Sent to customers or external parties
Sent for e-signature
Stored for compliance or audit
A formal legal document (contract, NDA)
Should not be edited after generation
Likely to be opened on mobile
  • The recipient needs to view the document directly in a browser without downloading it (use HTML)
  • The document needs to be embedded directly in a web page or portal (use HTML)
  • The document must be consumed as raw markup by another system (use HTML)
Page sizeA4 or Letter. Matches your configured page size setting. Set per template in template settings → Page Setup.
Page orientationPortrait (default) or Landscape. Use Landscape for wide tables — invoices, financial summaries with many columns.
Font embeddingSystem fonts (Arial, Calibri, Georgia) are embedded automatically. Custom fonts may not render correctly — use system-safe fonts for reliable PDF output across all readers.

HTML — Web Document

HTM

HTML (.html)

Web-native document — renders directly in a browser and is lightweight to store or embed

Use for web-based viewing and embedding
Viewed directly in a browser rather than downloaded
Embedded in a web page, portal, or community site
Needed quickly without a fixed print layout
Primarily text content without strict pagination needs
  • The document goes directly to a customer as a formal deliverable — use PDF
  • The document is used for e-signature — e-signature workflows require PDF format
  • Fixed pagination or a consistent print layout matters — HTML reflows based on the viewer's screen or print settings
RenderingThe output is standard HTML markup styled by the template — it renders consistently in any modern browser, but does not have the fixed pagination of PDF.
File sizeHTML output is typically smaller than an equivalent PDF, since it doesn't embed fonts or a fully rendered layout.
PrintingHTML documents can be printed from the browser, but page breaks and layout depend on the browser's print rendering rather than a fixed template layout.

HTML is a good choice when a document only needs to be viewed or embedded — for example, in an internal portal or a Salesforce community page. For anything sent externally as a formal deliverable, or requiring e-signature, use PDF instead.


Format comparison table

Feature / use case PDF HTML
Customer-facing delivery ✓ Best ✗ Not recommended
E-signature compatible ✓ Yes ✗ No
Editable after generation ✗ No (by design) ~ Via page source only
Rich formatting (images, colors) ✓ Full fidelity ✓ Mostly preserved
Fixed pagination / print layout ✓ Yes ✗ No (reflows to viewer)
Compliance / audit archival ✓ Best ✗ Not recommended
Universal device compatibility ✓ Best ✓ Any modern browser
Viewable directly in browser ~ Requires a PDF viewer ✓ Best
Embeddable in a web page or portal ✗ No ✓ Best

How to choose the right format

Answer these questions to identify the right format for your document type:

Format decision guide
Will this document go to an external recipient (customer, partner)?
Yes → PDF No → continue below
Will this document be signed electronically?
Yes → PDF (required for e-signature) No → continue below
Will this document be stored for compliance or legal purposes?
Yes → PDF No → continue below
Will this document be viewed in a browser or embedded in a web page/portal rather than downloaded?
Yes → HTML No → PDF

Setting the default output format

Dochly has three levels of format configuration — each overrides the one above it:

Org default (lowest priority)

Set in Dochly → Settings → General → Default Output Format. Applies to all templates and all generation attempts that don't have a more specific format configured. Set to PDF for most orgs.

Template default (mid priority)

Set per template in the template settings → Output Format. Overrides the org default for that specific template. Use this to set customer-facing templates to PDF while an internal reference template defaults to HTML.

Per-generation override (highest priority)

Set in the generation modal when clicking Generate Document. Overrides both org default and template default for that specific generation only.

Scheduled job override

Set in the scheduled job configuration. Applies to all generations within that job run, overriding the template default. Useful for running the same template as PDF for monthly billing but HTML for a quick internal review cycle.


Generating multiple formats at once

Dochly can generate more than one format from a single template in a single generation. Configure this in the template settings or the generation modal by selecting multiple output formats. Each selected format produces a separate Salesforce File on the record.

Common multi-format pattern

Generate both PDF and HTML from the same proposal template: PDF is sent to the customer and stored for the record; HTML is available for internal teams to quickly preview in a browser without downloading a file. Both files appear in the record's Files list.

Storage consideration

Each format generates a separate Salesforce File — so generating PDF + HTML creates two files per generation. For high-volume batch jobs, consider whether both formats are genuinely needed or if generating a single format reduces storage overhead.


Format and delivery considerations

The output format also affects what's possible for downstream delivery and processing:

E-signature

Only PDF documents can be sent for e-signature through Dochly's native e-signature feature. If a template is configured to output HTML, the Send for Signature option is unavailable until the format is changed to PDF.

Email delivery

Both formats can be emailed as attachments when configured in the generation settings. PDF is the most universally compatible email attachment — no software requirement for the recipient. HTML attachments open directly in a browser, but are less commonly used as email attachments.

Salesforce Files storage

Both formats store as native Salesforce Files (ContentDocument) and appear in the Files related list identically — the format only affects what happens when the file is opened or downloaded.

External integrations

If generated documents are automatically uploaded to Google Drive, SharePoint, or another system via a Salesforce Flow, ensure the target system accepts the format you're generating. Most integrations handle both formats, but some document management platforms have restrictions — confirm HTML support if that's your target format.


Frequently asked questions

Not natively within Dochly — Dochly generates the format you configure and stores it as a Salesforce File. To get both, configure the template to generate both PDF and HTML simultaneously so both are stored on the record from a single generation.
HTML rendering is controlled by the browser opening it — Chrome, Safari, Edge, and Firefox can render fonts and spacing slightly differently. Font availability is the most common cause: if a font used in the template isn't available to the browser, it substitutes a different font which can change line spacing and layout. Use system-safe, web-standard fonts for the most consistent HTML rendering across browsers.
No. Dochly generates documents in PDF or HTML format only. If your workflow requires a Word- or Excel-compatible file, you'll need to convert the HTML or PDF output outside of Dochly, or handle that conversion in a separate integration.

Document Generation series complete

You've covered the full Dochly document generation guide series — from generating your first document to scheduling automated workflows, troubleshooting errors, and choosing the right output format for every use case.

Dochly
Salesforce AppExchange — UTECH HUB Install Dochly on AppExchange

Rated 5 stars · Native Salesforce app · Free to install