Skip to main content

Print Templates

The Print Templates feature allows you to create and customize printable layouts for invoices and other supported entries. You can design templates that match your company’s branding and business requirements before exporting them as PDF documents.

Frappe Books includes several pre-built templates that you can use immediately or duplicate and customize.

Tip

If you’re creating your first template, duplicate one of the preloaded templates and customize it instead of starting from scratch.

Navigation

Navigation: Setup → Print Templates

You can also open the Quick Search, type Print Template, and select the matching result.

Preloaded Templates

Every new Frappe Books installation includes a collection of ready-to-use print templates.

  • Use them without modification.
  • Duplicate them before making customizations.
  • Edit the duplicate to preserve the original template.

Creating a Print Template

To create a new template:

  1. Navigate to Setup → Print Templates.
  2. Click the + button.
  3. The Template Builder opens automatically.
  4. Enable Edit Mode.
  5. Select the desired Template Type.
  6. Edit the template layout.
  7. Click Save to store the template.

Information

By default, the preview displays the most recently created entry of the selected document type. You can choose another entry at any time.

Custom Print Sizes

You can customize the paper size for your template using the Set Print Size option available in the menu.

This is useful for creating templates for receipts, invoices, labels, or custom document formats.

Editing the Template

The Template Builder includes a code editor where you can create or modify your template layout.

  • Edit existing HTML.
  • Remove the default layout and build your own.
  • Preview changes before saving.

Displaying Dynamic Values

Dynamic values are inserted using Vue.js template syntax with double curly braces.

<h1>{{ doc.name }}</h1>

For example, doc.name displays the document number inside the template.

Available Data Sources

Key Description
doc Displays values from the selected document, such as Invoice Number, Date, Customer, Items, and Total.
print Provides access to Print Settings such as Logo, Company Email, Colors, and other print configuration values.

Tip

Use the Key Hints panel below the editor to browse all available template variables and insert them into your layout.

Styling Templates

Templates can be styled using either:

  • Inline CSS styles.
  • Tailwind CSS utility classes.

Applying Template Changes

After editing the template, you can update the preview by:

  • Clicking outside the editor.
  • Pressing Ctrl + Enter (Windows/Linux).
  • Pressing ⌃ + Return (macOS).

Using a Print Template

After saving the template, it becomes available while printing supported entries.

  1. Open the required entry.
  2. Click Print.
  3. Select the desired template from the list.
  4. Preview the document.
  5. Click Save as PDF to export it.

Template Builder Interface

The Template Builder provides several tools for creating and previewing templates.

Component Purpose
Template Name Name of the print template.
Save as PDF Exports the current preview as a PDF.
Edit Mode Enables or disables template editing.
More Menu Provides additional options such as print settings and template management.
Save Saves the edited template.
Template Preview Displays a live preview of the template.
Template Editor Code editor used to modify the template.
Template Type Selects the document type for which the template is created.
Display Entry Selects the document used in the preview.
Display Scale Adjusts the preview zoom level.
Key Hints Lists all available template variables.

Best Practices

  • Duplicate preloaded templates before making changes.
  • Use the preview to validate your design before saving.
  • Use Key Hints to avoid incorrect variable names.
  • Keep custom styling simple for better compatibility across PDF viewers.
  • Avoid relying on customized Tailwind color classes, as they may change in future updates.
Rating: 0 / 5 (0 votes)