Skip to main content

AI Template Generation

Create and edit PDF templates in the Dashboard using AI prompts and optional reference files. AI generates a complete template with HTML/CSS, Handlebars variables, sample JSON data, and PDF settings. Review and preview the draft, then refine it as needed before publishing.

Use an AI Assistant

Create and manage PDF templates through your AI assistant with the PDFBolt MCP server.

Create a Template with AI​

1. Click Create Template in the Templates section of your Dashboard.

Templates section in Dashboard with Create Template button

2. Enter a Template Name and select the Template Engine.

3. Select Generate with AI as your creation method.

Create Template modal with Generate with AI option selected

4. Enter a detailed description of the template you want to create. You can also attach reference files to give the AI more context.

AI prompt input with file attachments

5. Click Generate with AI and wait for your template. Generation usually takes 1–3 minutes, depending on the prompt, reference files, and output size.

6. Check the generated template in Quick HTML Preview and refine it in the Template Designer as needed.

7. Generate a Real PDF Preview to check page breaks, fonts, and print styles. Successful previews use your available document conversions.

Template Designer with PDF preview

8. Publish the template when it is ready. Only published versions can be used with the Conversion API.

Template API

You can also manage and publish the draft through the Template API.

Write an Effective Prompt​

Prompt Tips

The more specific your description, the better the results. Include details about:

  • Layout structure: describe sections, columns, and how elements should be positioned.
  • Data fields: specify what information to display and where (names, dates, addresses, line items, totals).
  • Visual elements: mention if you need images, logos, charts, QR codes, or barcodes.
  • Styling: indicate a color scheme, font preferences, borders, or reference a style (e.g., "modern", "minimalist", "formal").
  • Page format: specify the size (A4, Letter, A6), orientation (portrait, landscape), and header/footer requirements.

Prompt limit: 10,000 characters.

Example Invoice Prompt
Create a professional invoice template. Header: company logo on the left, company details (name, address, phone, email, website) on the right. Below the header, a full-width row with invoice number, issue date, and due date. Two address blocks side by side: 'Bill From' and 'Bill To' – each with name, company, address, city, postal code, and country. Main section: itemized table with columns for description, quantity, unit price, and line total. Below the table: subtotal, discount (percentage and amount), tax (rate and amount), and total highlighted. At the bottom: payment terms, QR code for payment, and a short thank you message. Footer with page numbers. Clean modern styling with blue accent color.

Attach Reference Files​

You can attach reference files to give the AI more details about your template:

File attachment area with drag and drop

Supported file types:

  • Documents: PDF
  • Images: PNG, JPG, JPEG, SVG (including pasted screenshots)
  • Text & Code: HTML, CSS, JavaScript, JSON, TXT

How to attach files:

  • Drag and drop files into the attachment area.
  • Click to browse and select files.
  • Paste an image from the clipboard (Ctrl+V / Cmd+V).

File limits:

PlanMax Total SizeMax Files
Free1 MB5
Paid5 MB5
File privacy

Reference files provide context for the AI operation. They are not stored as template assets or used to train AI models.

Example use cases:

  • Attach a PDF of an existing document you want to recreate.
  • Include a logo to help the AI match the template style to your branding.
  • Share a screenshot of a design you'd like to replicate.
  • Provide sample HTML/CSS for reference.

What AI Generates​

When the AI creates your template, you receive:

ComponentDescription
HTML TemplateComplete HTML/CSS code with Handlebars variables.
Sample DataJSON data structure matching your template variables.
PDF ParametersPage format, orientation, background printing, rendering wait conditions, and optional headers and footers.

You can edit the generated template manually in the Template Designer or request changes with AI Assist.

Edit a Template with AI​

Use AI Assist to edit any template, including templates created manually, generated with AI, or selected from the gallery.

1. In the Template Designer, click AI Assist in the code editor toolbar.

AI Assist button

2. Describe the changes you want to make. You can also attach reference files for additional context.

3. Click Prepare Changes and wait for the AI to prepare a proposed update.

AI Assist edit prompt modal

4. Review the proposed changes in Review AI Changes, then click Accept to apply them or Reject to discard them.

Example Edit Instructions

Adding elements:

  • Add a discount field to the invoice.
  • Add a QR code in the top right corner.
  • Include a notes/comments section after the items table.

Styling changes:

  • Change the color scheme to blue and white.
  • Make the table headers bold and add alternating row colors.
  • Increase font size and add more spacing between sections.

Layout modifications:

  • Move the logo to the center and make it larger.
  • Add a sidebar with contact information.
  • Split the address section into two columns.

You can refine the template through successive edits.

Review AI Changes​

Review the proposed changes in the Review AI Changes modal before applying them.

Code View​

Compare changes across three tabs:

  • Template: side-by-side comparison of HTML/CSS and Handlebars code.
  • Data: changes to sample JSON data.
  • Parameters: changes to PDF settings, including page format, orientation, background printing, rendering wait conditions, and headers and footers.
Review AI Changes modal with code diff view

PDF Preview​

Open the PDF Preview tab to compare the original (1) and updated (2) PDFs side by side. Each successfully rendered PDF uses your available document conversions.

Review AI Changes modal with PDF preview comparison

Accept or Reject​

After reviewing the changes:

  • Click Accept to apply the proposed changes.
  • Click Reject to discard them and try a different prompt.

After accepting the changes, save the draft manually or use auto-save. Publish the draft to make the updated version available to the Conversion API.

AI Generation Limits​

AI generations and document conversions are separate quotas. Each AI request to create or edit a template uses one AI generation. Successful PDF previews use document conversions.

PlanAI Generations
Free1 (one-time)
Basic10 / month
Growth50 / month
Enterprise150 / month
  • A generation is consumed when the request is accepted for processing, even if processing later fails or you reject the suggested edit.
  • The Free plan includes one generation at registration. It does not renew.
  • Paid-plan quotas renew monthly with your billing cycle.
  • Check your remaining AI generations in the Dashboard navigation bar.
Using AI on the Free Plan

On the Free plan, you need to add a payment method to access AI features. The card is used for verification only. No charges are made on the Free plan.

Troubleshooting​

If AI generation or editing fails, check these common issues:

ProblemWhat to Do
No AI generations leftPaid-plan quotas renew monthly with your billing cycle. The Free plan includes one non-renewing generation. Upgrade to a paid plan to get more AI generations.
Payment method requiredAdd a payment method for verification. No charges are made on the Free plan.
AI system is experiencing high demandAI access on the Free plan is temporarily unavailable. Try again later.
Prompt is too longReduce your prompt to 10,000 characters or less.
Total attachment size exceeds the limitReduce the total file size to 1 MB on the Free plan or 5 MB on paid plans.
Unsupported file typeUse one of: PDF, PNG, JPG/JPEG, SVG, TXT, HTML/HTM, CSS, JS, or JSON.
Too many attachmentsAttach up to 5 files per request.
Empty promptDescribe the template you want to create or the changes you want to make.
Content policy violationRevise the prompt or reference files so they comply with the usage policy, then try again.
Template and sample data are too large for AI editingSimplify the current template or sample data before requesting AI edits.