> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/sdocs/template-architecture.md).

# Template Architecture

- [Inserting Merge Fields](https://help.sdocs.com/sdocs/template-architecture/inserting-merge-fields.md): Learn how merge fields work in S-Docs, then choose the right guide for Template Editor, Microsoft templates, or focused troubleshooting.
- [Special Merge Fields](https://help.sdocs.com/sdocs/template-architecture/inserting-merge-fields/special-merge-fields.md): Use special merge fields to pull document metadata, record IDs, page numbers, and generating user details into an S-Docs template.
- [Merge Fields With Template Editor](https://help.sdocs.com/sdocs/template-architecture/inserting-merge-fields/merge-fields-with-template-editor.md): Learn what merge fields are, how to add them to a template, and which attributes are most useful day to day.
- [Merge Fields With Microsoft Templates (DOCX, PPTX, XLSX)](https://help.sdocs.com/sdocs/template-architecture/inserting-merge-fields/merge-fields-with-microsoft-templates-docx-pptx-xlsx.md): Learn how to add merge fields to DOCX templates and use the square-bracket syntax required in Microsoft Word files.
- [Additional Resources](https://help.sdocs.com/sdocs/template-architecture/inserting-merge-fields/additional-resources.md)
- [Mailing Address Fields](https://help.sdocs.com/sdocs/template-architecture/inserting-merge-fields/additional-resources/special-salesforce-mailing-address-fields.md)
- [Quickly Traverse Five Levels](https://help.sdocs.com/sdocs/template-architecture/inserting-merge-fields/additional-resources/quickly-traverse-five-levels.md)
- [Rich Text Field Formatting Considerations](https://help.sdocs.com/sdocs/template-architecture/inserting-merge-fields/additional-resources/concerns-with-using-rich-text-field-formatting.md): Clean up extra spacing from rich text fields and control paragraph tags in merge fields and related lists.
- [Style Templates](https://help.sdocs.com/sdocs/template-architecture/template-authoring.md): Learn how styling works in the S-Docs Template Editor, where to apply CSS, and which guides to use for common design tasks.
- [Related List Tables and CSS](https://help.sdocs.com/sdocs/template-architecture/template-authoring/related-list-tables-and-css.md)
- [S-Docs Template Development Best Practices](https://help.sdocs.com/sdocs/template-architecture/template-authoring/s-docs-template-development-best-practices.md)
- [Adding a Background Image or Watermark](https://help.sdocs.com/sdocs/template-architecture/template-authoring/how-to-add-a-background-image-or-watermark.md)
- [CSS Styling with Merge Fields](https://help.sdocs.com/sdocs/template-architecture/template-authoring/css-styling-with-merge-fields.md)
- [Table Formatting: How-To Guide](https://help.sdocs.com/sdocs/template-architecture/template-authoring/table-formatting-how-to-guide.md)
- [Configure Template Settings](https://help.sdocs.com/sdocs/template-architecture/template-settings.md)
- [Header And Footer Tabs](https://help.sdocs.com/sdocs/template-architecture/template-settings/header-and-footer-tabs.md): Use the Header and Footer tabs to add repeating content above and below the document body, including first-page-only and remaining-page layouts.
- [Multiple Pages with Different Page Margins](https://help.sdocs.com/sdocs/template-architecture/template-settings/header-and-footer-tabs/multiple-pages-with-different-page-margins.md): Use page-specific CSS and \`pagebody\` tags to apply different margins or orientation within one PDF template.
- [Page Settings Tab](https://help.sdocs.com/sdocs/template-architecture/template-settings/page-settings-tab.md): Use Page Settings to control page size, orientation, margins, and measurement units in the Template Editor.
- [Page Settings Quick Reference](https://help.sdocs.com/sdocs/template-architecture/template-settings/page-settings-tab/page-settings-quick-reference.md)
- [How to Configure Custom Page Sizes](https://help.sdocs.com/sdocs/template-architecture/template-settings/page-settings-tab/how-to-configure-custom-page-sizes.md): Configure custom page dimensions, units, and margins for labels, cards, letterhead, and international paper sizes.
- [Document Options Tab](https://help.sdocs.com/sdocs/template-architecture/template-settings/document-options-tab.md): Use Document Options to control output names, storage, edit behavior, and general generation settings.
- [Document Options Quick Reference](https://help.sdocs.com/sdocs/template-architecture/template-settings/document-options-tab/document-options-quick-reference-tables.md): Scan Document Options settings in table format, including file naming, storage, edit behavior, and general generation options.
- [How to Handle International Characters](https://help.sdocs.com/sdocs/template-architecture/template-settings/document-options-tab/how-to-handle-international-characters.md): Enable Unicode support and choose the right enforcement level and fonts for international characters.
- [How to Create Dynamic File Names](https://help.sdocs.com/sdocs/template-architecture/template-settings/document-options-tab/how-to-create-dynamic-file-names.md): Use merge fields in Output File Format to generate clear, searchable file names automatically.
- [How to Auto-Attach Documents to Records](https://help.sdocs.com/sdocs/template-architecture/template-settings/document-options-tab/how-to-auto-attach-documents-to-records.md): Save generated documents to Salesforce Files or Attachments automatically.
- [Email Settings Tab](https://help.sdocs.com/sdocs/template-architecture/template-settings/email-settings-tab.md): Use Email Settings to control email subject, recipients, sender behavior, and outbound email restrictions.
- [Email Settings Quick Reference](https://help.sdocs.com/sdocs/template-architecture/template-settings/email-settings-tab/email-settings-quick-reference-tables.md): Scan Email Settings in table format, including subject, recipients, sender controls, and other email delivery options.
- [Email Delivery and Security](https://help.sdocs.com/sdocs/template-architecture/template-settings/email-settings-tab/email-delivery-and-security.md): Configure sender behavior, locked email fields, and domain restrictions for secure document delivery.
- [Advanced Options Tab](https://help.sdocs.com/sdocs/template-architecture/template-settings/advanced-options-tab.md): Use Advanced Options for template preview, export, and feature-specific integrations.
- [Advanced Options Quick Reference](https://help.sdocs.com/sdocs/template-architecture/template-settings/advanced-options-tab/advanced-options-quick-reference.md)
- [How to Set Up Template Preview](https://help.sdocs.com/sdocs/template-architecture/template-settings/advanced-options-tab/how-to-set-up-template-preview.md): Use a Salesforce record ID to preview a template with real data before rollout.
- [Template Lifecycle Management](https://help.sdocs.com/sdocs/template-architecture/template-settings/advanced-options-tab/template-lifecycle-management.md): Preview, export, import, and maintain templates across development and deployment cycles.
- [Insert Images](https://help.sdocs.com/sdocs/template-architecture/images-in-s-docs.md)
- [Static Image Solutions](https://help.sdocs.com/sdocs/template-architecture/images-in-s-docs/static-image-solutions.md)
- [How to: Remote Site Settings](https://help.sdocs.com/sdocs/template-architecture/images-in-s-docs/static-image-solutions/how-to-remote-site-settings.md): This page will outline how to create a new Remote Site so that images within a Salesforce Organization can be used externally.
- [How to: Add Images as Static Resources](https://help.sdocs.com/sdocs/template-architecture/images-in-s-docs/static-image-solutions/images-as-static-resources.md): This is a guide to show how to add images as a static resource within Salesforce to then leverage within S-Docs Templates.
- [How to: Add Images as Salesforce Documents](https://help.sdocs.com/sdocs/template-architecture/images-in-s-docs/static-image-solutions/how-to-add-images-as-salesforce-documents.md): This page will walk a user through adding a static image as a document to be used throughout an Org.
- [How to: Use Bar Codes & QR Codes](https://help.sdocs.com/sdocs/template-architecture/images-in-s-docs/static-image-solutions/how-to-use-bar-codes-and-qr-codes.md): This page will walk a user through adding Bar Codes or QR Codes to be leveraged within S-Docs Templates.
- [Dynamic Image Solutions](https://help.sdocs.com/sdocs/template-architecture/images-in-s-docs/dynamic-image-solutions.md)
- [How to: Images & Related Lists](https://help.sdocs.com/sdocs/template-architecture/images-in-s-docs/dynamic-image-solutions/related-list-examples-that-pull-images-stored-in-files-attachments.md): This page will guide the user through how to pull images from Salesforce Object Records that are stored in the Files or Attachments related lists.
- [How to: Place Images in Columns](https://help.sdocs.com/sdocs/template-architecture/images-in-s-docs/dynamic-image-solutions/placing-images-in-columns.md): This page will guide the user through generating a related list and generating images from that related list.
- [How to: Resize Images from Fields](https://help.sdocs.com/sdocs/template-architecture/images-in-s-docs/dynamic-image-solutions/resize-images-in-rich-text-field.md): This page will instruct how to resize images in a rich text field.
- [How to: Use a CSS Selector](https://help.sdocs.com/sdocs/template-architecture/images-in-s-docs/dynamic-image-solutions/insert-field-image-resize.md): This guide will walk users through how to use CSS and more specifically a CSS Selector to resize an image.
- [Images from Files](https://help.sdocs.com/sdocs/template-architecture/images-in-s-docs/dynamic-image-solutions/images-from-files.md)
- [Document Formats](https://help.sdocs.com/sdocs/template-architecture/document-formats.md): Choose the right S-Docs output format, then jump to setup, examples, and format-specific guidance.
- [PDF Templates](https://help.sdocs.com/sdocs/template-architecture/document-formats/pdf-templates.md): Choose the right PDF format, see example outputs, copy a starter template, and learn the main PDF rules.
- [PDF Rendering Considerations](https://help.sdocs.com/sdocs/template-architecture/document-formats/pdf-templates/pdf-rendering-considerations.md): Understand the main Salesforce PDF rendering considerations before you build or troubleshoot PDF templates.
- [Supported Fonts in PDF Format](https://help.sdocs.com/sdocs/template-architecture/document-formats/pdf-templates/supported-fonts-in-pdf-format.md)
- [Bold and Italics with Unicode Fonts In PDF](https://help.sdocs.com/sdocs/template-architecture/document-formats/pdf-templates/bold-and-italics-with-unicode-fonts-in-pdf.md): Troubleshoot PDF templates where bold or italic text stops working after Unicode fonts are enabled.
- [Upload Existing PDFs](https://help.sdocs.com/sdocs/template-architecture/document-formats/pdf-upload-format.md): Upload a finished PDF and place Salesforce data on top of it with drag-and-drop fields.
- [How To: Upload PDF To S-Docs (Classic Editor)](https://help.sdocs.com/sdocs/template-architecture/document-formats/pdf-upload-format/pdf-upload-format-how-to-guide.md)
- [How to: Upload a PDF as a Template](https://help.sdocs.com/sdocs/template-architecture/document-formats/pdf-upload-format/how-to-upload-a-pdf-as-a-template-draft.md): PDF-Upload is a template format where users can take an existing PDF Document (S-Docs generated or not) and upload it through the template editor to generate future S-Docs.
- [How to: Center Text With PDF-Upload Merge Fields](https://help.sdocs.com/sdocs/template-architecture/document-formats/pdf-upload-format/centering-text-in-pdf-upload-merge-fields.md): Center text in a PDF-upload merge field by updating the Additional Style value.
- [Quick Reference: Named Queries for PDF Upload Templates](https://help.sdocs.com/sdocs/template-architecture/document-formats/pdf-upload-format/named-queries-for-pdf-upload-templates-reference.md)
- [HTML Email Templates](https://help.sdocs.com/sdocs/template-architecture/document-formats/html-email-format.md): Build merged email content in S-Docs when the output should be sent as email, not generated as a file.
- [Microsoft Word (DOCX)](https://help.sdocs.com/sdocs/template-architecture/document-formats/docx-s-docs.md)
- [Build and Upload a DOCX Template](https://help.sdocs.com/sdocs/template-architecture/document-formats/docx-s-docs/build-and-upload-a-docx-template.md): Design the document in Microsoft Word, add bracketed S-Docs syntax, upload the .docx file, and generate editable Word output from Salesforce data.
- [DOCX Rendering Considerations](https://help.sdocs.com/sdocs/template-architecture/document-formats/docx-s-docs/docx-rendering-considerations.md): Understand the main DOCX rendering considerations before you build or troubleshoot Word-based templates.
- [Additional Resources](https://help.sdocs.com/sdocs/template-architecture/document-formats/docx-s-docs/additional-resources.md)
- [DOCX Generation Failure: SpellStart, GramStart, or GramEnd](https://help.sdocs.com/sdocs/template-architecture/document-formats/docx-s-docs/additional-resources/docx-generation-failure-spellstart.md): Fix DOCX generation failures caused by Microsoft Word spelling and grammar markup inside the uploaded template.
- [Use Checkbox Symbols in DOCX Templates](https://help.sdocs.com/sdocs/template-architecture/document-formats/docx-s-docs/additional-resources/checkboxes-with-docx.md): Replace boolean values with Unicode checkbox characters when you need checkbox-style output in a DOCX template.
- [How to Add a Subtotal Row to a DOCX Table](https://help.sdocs.com/sdocs/template-architecture/document-formats/docx-s-docs/additional-resources/add-a-subtotal-line-to-the-end-of-a-table-in-docx.md): Keep subtotal and total rows attached to a DOCX table so they render as one complete table.
- [PowerPoint (PPTX)](https://help.sdocs.com/sdocs/template-architecture/document-formats/pptx-format.md)
- [PPTX Rendering Considerations](https://help.sdocs.com/sdocs/template-architecture/document-formats/pptx-format/pptx-rendering-considerations.md): Understand the main PPTX rendering considerations before you build or troubleshoot PowerPoint-based templates.
- [Build and Upload a PPTX Template](https://help.sdocs.com/sdocs/template-architecture/document-formats/pptx-format/build-and-upload-a-pptx-template.md): Design slides in Microsoft PowerPoint, add bracketed S-Docs syntax, upload the .pptx file, and generate dynamic presentations from Salesforce data.
- [Excel (XLSX)](https://help.sdocs.com/sdocs/template-architecture/document-formats/xlsx-format.md): Choose XLSX when you need spreadsheet-first output, Excel-native formatting, and bracket-based Microsoft template syntax.
- [XLSX Rendering Considerations](https://help.sdocs.com/sdocs/template-architecture/document-formats/xlsx-format/xlsx-rendering-considerations.md): Understand the main XLSX rendering considerations before you build or troubleshoot Excel-based templates.
- [Build and Upload an XLSX Template](https://help.sdocs.com/sdocs/template-architecture/document-formats/xlsx-format/build-and-upload-an-xlsx-template.md): Design the workbook in Microsoft Excel, add bracketed S-Docs syntax, upload the .xlsx file, and generate dynamic spreadsheet output from Salesforce data.
- [Additional Formats](https://help.sdocs.com/sdocs/template-architecture/document-formats/other-formats.md)
- [Classic .doc Generation (DOC/DOC-NEW)](https://help.sdocs.com/sdocs/template-architecture/document-formats/other-formats/doc-doc-new-s-docs-1.md): Use legacy DOC and DOC-NEW formats, understand preview behavior, fix common RTF issues, and add page numbers.
- [leading zeroes for xls templates](https://help.sdocs.com/sdocs/template-architecture/document-formats/other-formats/leading-zeroes-for-xls-templates.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.sdocs.com/sdocs/template-architecture.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
