---
source: https://carbone.io/examples/prescription/
title: "Medical Prescription Template | Carbone Document Generator"
description: "Learn how to generate professional medical prescriptions using Carbone. Create custom prescription templates in DOCX format and merge them with JSON data to produce PDF documents efficiently."
generated_at: "2026-07-24"
---

# Prescription

Generate Professional Medical Prescriptions with Carbone

[![prescription thumbnail](/examples/prescription/thumb-result.webp)](/examples/prescription/result.pdf)

[Download Template](/examples/prescription/template.docx)

[Download data sample](/examples/prescription/data.json)

-   Template type document docx simple
-   Carbone min. v4.0.0+
-   Features loop html date alias count
-   Target Prescription Medical Healthcare Document Generation

## Overview

Learn how to generate professional medical prescriptions that include:

-   Organized information in tables
-   Dynamic patient and doctor details
-   Proper date formatting
-   Digital signatures

## Step-by-Step Guide

### 1\. Design the Basic Layout

Create a professional header with:

-   Your medical practice logo
-   Basic information
-   Any required illustrative elements

### 2\. Create the Prescription Table

-   Insert a table:
    
    -   Go to the **Insert** menu
    -   Select **Table**
    -   Create a table with appropriate dimensions (e.g., 6x3)
    -   Add column headers
-   Add dynamic data:
    
    -   Insert [Carbone tags](/documentation/design/substitutions/the-basics.md#basic) for dynamic content
    -   Example: `{d.pres[i].name}` for medication names
    -   Use `[i+1]` notation for array iteration (e.g., `{d.pres[i+1]}`)

> ℹ️ **Note:** You can enhance table appearance by applying styles from the **Table Design** menu.

### 3\. Implement Aliases for Better Code Readability

-   Define [aliases](/documentation/design/substitutions/aliases.md) using `#`:
    
    ```text
    {#doctorPR = d.doctor.profile.personal}
    ```
    
-   Reference aliases using `$`:
    
    ```text
    {$doctorPR.name.f}
    ```
    

### 4\. Handle Dates Professionally

-   Current date insertion:
    
    -   Use `{c.now}` for current UTC date
    -   Apply the [:formatD](/documentation/design/formatters/date.md#formatd-patternout-patternin) formatter with specific [patterns](/documentation/design/formatters/date.md#date-formats)
    -   Example: `{c.now:formatD(LLLL)}`
-   Future dates:
    
    -   Use [:addD](/documentation/design/formatters/date.md#addd-amount-unit-patternin) formatter for date calculations
    -   Example: `{c.now:addD('15','day'):formatD(LLLL)}`

### 5\. Add Digital Signatures

-   Insert a placeholder image
-   Configure dynamic signature:
    -   Right-click the image
    -   Select **View Alt Text**
    -   Set the path: `{$doctorp.signature}`

### Technical Tips for Better Layout

Prevent Row Breaks Across Pages

-   Select the entire table
-   Right-click → **Table Properties**
-   Go to **Row** tab
-   Uncheck "Allow rows to break across pages"

Repeat Headers on New Pages

-   Select the table's header row
-   Right-click → **Table Properties**
-   Go to **Row** tab
-   Check "Repeat as header row at the top of each page"

## Related Examples

[![certificat thumbnail example](/examples/certificat/thumb-result.webp)](/examples/certificat/index.md)

## Trusted by 800+ paid customers in 40+ countries

## Related topics

- [Transport ticket](/examples/ticket/index.md)
- [Summary](/examples/summary/index.md)
- [Stock inventory spreadsheet](/examples/stock-inventory-spreadsheet/index.md)
- [Store Inventory](/examples/shoes/index.md)
- [Sensor readings](/examples/sensor-readings/index.md)
- [Real estate property document](/examples/real-estate-property-description/index.md)
