# PDF Rendering Considerations

S-Docs PDF templates use Salesforce PDF rendering.

That engine works well for print-style documents. It also has a few important considerations to plan around.

### Key Considerations

* Some HTML and CSS rules render differently than they do in a browser.
* PDF output relies on Salesforce's rendering engine.
* The PDF rendering service outputs PDF version `1.4` and supports CSS up to version `2.1`.
* JavaScript-rendered content is not supported.
* Interactive form elements may not behave as expected in PDF output.
* Modern web layout patterns are often less reliable than simple print markup.
* Multilingual characters need extra testing.
* Font support is more limited than in a browser.
* Large pages, large PDFs, and heavy image usage can approach Salesforce rendering limits.

### Not currently available

These PDF capabilities are not currently available:

* fillable PDFs
* password-protected PDFs

### What To Avoid

Avoid these patterns in PDF templates when possible:

* buttons, inputs, and browser-driven form behavior
* JavaScript-dependent content
* complex responsive layouts
* advanced CSS that depends on modern browser support

Table-based layouts and simple CSS are usually the safest choice.

### Font and language considerations

PDF rendering has stricter font support than normal browser output.

Salesforce documents four core PDF font families, plus `Arial Unicode MS` for multibyte characters, in its [supported fonts reference](https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_output_pdf_supported_fonts.htm).

Use it when your document includes non-Latin characters or multilingual content. Even then, test with real data before rollout.

{% hint style="warning" %}
If your template includes international characters, do not assume browser output and PDF output will match.
{% endhint %}

Some standard Visualforce components also have font-related limits in PDF output.

For example, components such as `apex:pageBlock` and `apex:sectionHeader` are not the best choice for double-byte font rendering.

### Salesforce rendering thresholds

Salesforce also applies hard limits during PDF generation:

* The page response before PDF rendering cannot exceed `15 MB`.
* The generated PDF file cannot exceed `60 MB`.
* Total image data included in the PDF cannot exceed `30 MB`.

These limits matter most for:

* image-heavy documents
* long reports
* packet-style PDFs with many related list rows

### Inline CSS requirements

Inline CSS works only under specific conditions.

If you rely on inline styles in a Visualforce PDF page, use:

* API version `28.0` or later
* `applyBodyTag="false"` on `apex:page`
* explicit, valid `html`, `head`, and `body` tags

Without that structure, inline styling may not render as expected.

### Best practice

Build PDFs like printable documents, not web pages.

Use:

* simple HTML structure
* table-based alignment when layout must stay fixed
* basic CSS
* supported fonts

Test early if your template includes:

* multiple languages
* special characters
* rich text fields
* complex spacing or page layout

### Troubleshooting tip

If you are unsure whether an issue comes from the PDF engine, test the same pattern in a simple Visualforce PDF page.

That helps confirm whether the behavior is a Salesforce rendering limit or a template issue.

When a PDF fails or renders inconsistently, check these first:

* unsupported JavaScript or dynamic browser behavior
* unsupported fonts or multilingual characters
* oversized images or overall output size
* CSS that depends on browser features instead of print-safe markup

### Related resources

* Review [PDF Templates](/sdocs/template-architecture/document-formats/pdf-templates.md) for format guidance and build patterns.
* Review [Supported Fonts in PDF Format](/sdocs/template-architecture/document-formats/pdf-templates/supported-fonts-in-pdf-format.md) for font-specific details.
* Review [PDF Render Limitations](broken://spaces/WKNnJmhJBQwhdk5WBFsi/pages/3ccb810031f9ead1d614975ed1c05651aa01130d) for additional background and a Visualforce test example.
* Review Salesforce's [PDF rendering considerations](https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_output_pdf_considerations.htm).
* Review Salesforce's [supported PDF fonts](https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_output_pdf_supported_fonts.htm).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.sdocs.com/sdocs/template-architecture/document-formats/pdf-templates/pdf-rendering-considerations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
