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

# PDF template

PDF-based invoicing offers a secure, professional, and easily accessible way to deliver invoices. With its standardized format, it ensures consistent presentation across devices, simplifies record-keeping, and reduces the likelihood of tampering, providing reliability and ease for both businesses and clients.

<Note>PDF-based invoicing is only available for **premium plans**.</Note>

# Templating

You can provide a custom template for your PDF-based invoicing. Templates use standardized HTML syntax and allow for both basic and advanced customization.

To allow templating, Plude use [Handlebars](https://handlebarsjs.com/guide/) syntax.

## Syntax

Handlebars is a simple templating language. It uses a template and an input object to generate HTML or other text formats. Handlebars templates look like regular text with embedded Handlebars expressions.

```HTML theme={null}
<p>{{firstname}} {{lastname}}</p>
```

## Footers

You can append a footer to all pages by adding a `<footer>` tag. Only text inside the footer is allowed, no HTML.

```HTML theme={null}
<footer>
    This will be displayed on all pages.
</footer>
```

## Helpers

Plude provide a list of different helpers to code the template.

### #if

You can use the if helper to conditionally render a block. If its argument returns false, undefined, null, "", 0, or \[], Handlebars will not render the block.

```HTML theme={null}
<div>
{{#if name}}
Name will be displayed
{{/if}}
</div>
```

### #unless

You can use the unless helper as the inverse of the if helper. Its block will be rendered if the expression returns a falsy value.

```HTML theme={null}
<div>
{{#unless name}}
Name will be not displayed
{{/unless}}
</div>
```

### #each

Each provide a for-loop to iterate arrays.

```HTML theme={null}
<ol>
    {{#each Items}} 
        <li>{{name}}</li>
    {{/each}}
</ol>
```

### #with

The with-helper allows you to change the evaluation context of template-part.

```HTML theme={null}
<div>
{{#with Customer}}
<span>Name {{Name}}</span>
{{/with}}
</div>
```

### #format

Format enables output formatting. Format use a variable defining the format of the value.

> \#format **value** **variable**

```HTML theme={null}
<div>
Format a date: {{#format Date 'd'}} or a number: {{#format Amount 'N'}}
</div>
```

### #money (currencies)

You can format money and currencies using the money helper.

> \#money **value** **currency**

```HTML theme={null}
<span>
Total amount is {{#money Amount Currency}}
</span>
```

### #due

You can use due to determine if date is due. Date will be compared with the current time and date.

```HTML theme={null}
<div>
{{#due Date}}
date is due
{{else}}
date is not due
{{/due}}
</div>
```
