> ## Documentation Index
> Fetch the complete documentation index at: https://docs.medwrite.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add PDF Template

> Add a PDF template for letter or document output

Add a PDF template from **Template Management**. After you choose organisation, template type, and optional clinic, you design the HTML layout and select **variables** so the right **patient and letter details** are inserted **dynamically** into each exported PDF.

<Steps>
  <Step title="Add New Template button">
    In the templates or documents area, click **Add New Template** to start adding a PDF template.

    <Frame caption="Add New Template button.">
      <img alt="Add New Template button" style={{ borderRadius: '0.5rem', maxWidth: '100%' }} lightAlt="Add New Template button" darkAlt="Add New Template button" src="https://mintcdn.com/medwriteai/5wp1zTLvuLiTjDfk/images/Screenshot_4-5-2026_151935_dev.medwrite.ai-1.jpeg?fit=max&auto=format&n=5wp1zTLvuLiTjDfk&q=85&s=08c4ff0c7188f22e1e430a77162b96b0" className="dark:hidden" width="2491" height="1060" data-path="images/Screenshot_4-5-2026_151935_dev.medwrite.ai-1.jpeg" />

      <img alt="Add New Template button" style={{ borderRadius: '0.5rem', maxWidth: '100%' }} lightAlt="Add New Template button" darkAlt="Add New Template button" src="https://mintcdn.com/medwriteai/5wp1zTLvuLiTjDfk/images/Screenshot_4-5-2026_151935_dev.medwrite.ai-1-1.jpeg?fit=max&auto=format&n=5wp1zTLvuLiTjDfk&q=85&s=5936ec43fbae9755a7d4ef94cf87b736" className="hidden dark:block" width="2491" height="1060" data-path="images/Screenshot_4-5-2026_151935_dev.medwrite.ai-1-1.jpeg" />
    </Frame>
  </Step>

  <Step title="Select Organisation and Template Type">
    Under **Clinic (optional)**, choose **Organisation template** or a specific clinic.

    <Frame caption="Popup: select Organisation and Template Type.">
      <img src="https://mintcdn.com/medwriteai/5wp1zTLvuLiTjDfk/images/Screenshot_4-5-2026_152136_dev.medwrite.ai-(1).jpeg?fit=max&auto=format&n=5wp1zTLvuLiTjDfk&q=85&s=859af6d32fcbdff7a26459cbea123872" alt="Select Organisation and Template Type in popup" style={{ borderRadius: '0.5rem', maxWidth: '100%' }} lightAlt="Select Organisation and Template Type in popup" darkAlt="Select Organisation and Template Type in popup" className="dark:hidden" width="2541" height="835" data-path="images/Screenshot_4-5-2026_152136_dev.medwrite.ai-(1).jpeg" />

      <img src="https://mintcdn.com/medwriteai/5wp1zTLvuLiTjDfk/images/Screenshot_4-5-2026_152136_dev.medwrite.ai-(1)-1.jpeg?fit=max&auto=format&n=5wp1zTLvuLiTjDfk&q=85&s=f422b0249e02dd7e84bb8fcd454bfa1d" alt="Select Organisation and Template Type in popup" style={{ borderRadius: '0.5rem', maxWidth: '100%' }} lightAlt="Select Organisation and Template Type in popup" darkAlt="Select Organisation and Template Type in popup" className="hidden dark:block" width="2541" height="835" data-path="images/Screenshot_4-5-2026_152136_dev.medwrite.ai-(1)-1.jpeg" />
    </Frame>
  </Step>

  <Step title="Edit the PDF design in the HTML editor">
    After you select organisation, template type, and optional clinic, the **HTML Content Editor** opens. Use the HTML to control **layout and styling** (headings, tables, branding). Add **placeholders** in the markup for any **dynamic** details you want in the final PDF (patient name, dates, letter text, and other fields). Open **Variables**, tick the **dynamic fields** you want MedWrite to merge for this template, and keep them aligned with your HTML. Use **Run** to preview (you can add sample **context data** for testing). When the design is correct, **Publish Template** to save it for live letters.

    <Frame caption="HTML editor for PDF template design.">
      <img src="https://mintcdn.com/medwriteai/R5Bs1ncwatpjoUpI/images/addPDF-template/templateHtmlEditor.png?fit=max&auto=format&n=R5Bs1ncwatpjoUpI&q=85&s=76811662535bf75c338be4f2e16b0b7c" alt="HTML editor for PDF template design" style={{ borderRadius: '0.5rem', maxWidth: '100%' }} width="2517" height="1139" data-path="images/addPDF-template/templateHtmlEditor.png" />
    </Frame>
  </Step>
</Steps>

## Next steps

<Columns cols={2}>
  <Card title="Manage Templates" icon="table-layout" href="/essentials/manage-templates">
    Create and manage letter and document templates.
  </Card>

  <Card title="Add Word Template" icon="file-word" href="/essentials/add-word-template">
    Add a Word template for letter output.
  </Card>
</Columns>
