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.
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.
2. Enter a Template Name and select the Template Engine.
3. Select Generate with AI as your creation method.
4. Enter a detailed description of the template you want to create. You can also attach reference files to give the AI more context.
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.
8. Publish the template when it is ready. Only published versions can be used with the Conversion API.
You can also manage and publish the draft through the Template API.
Write an Effective Prompt
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:
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:
| Plan | Max Total Size | Max Files |
|---|---|---|
| Free | 1 MB | 5 |
| Paid | 5 MB | 5 |
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:
| Component | Description |
|---|---|
| HTML Template | Complete HTML/CSS code with Handlebars variables. |
| Sample Data | JSON data structure matching your template variables. |
| PDF Parameters | Page 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.
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.
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.
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.
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.
| Plan | AI Generations |
|---|---|
| Free | 1 (one-time) |
| Basic | 10 / month |
| Growth | 50 / month |
| Enterprise | 150 / 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.
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:
| Problem | What to Do |
|---|---|
No AI generations left | Paid-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 required | Add a payment method for verification. No charges are made on the Free plan. |
AI system is experiencing high demand | AI access on the Free plan is temporarily unavailable. Try again later. |
Prompt is too long | Reduce your prompt to 10,000 characters or less. |
Total attachment size exceeds the limit | Reduce the total file size to 1 MB on the Free plan or 5 MB on paid plans. |
Unsupported file type | Use one of: PDF, PNG, JPG/JPEG, SVG, TXT, HTML/HTM, CSS, JS, or JSON. |
Too many attachments | Attach up to 5 files per request. |
Empty prompt | Describe the template you want to create or the changes you want to make. |
Content policy violation | Revise the prompt or reference files so they comply with the usage policy, then try again. |
Template and sample data are too large for AI editing | Simplify the current template or sample data before requesting AI edits. |
Related Resources
📄️ PDFBolt MCP Server
Create and manage PDF templates through your AI assistant
📄️ Template Management
Complete template creation and management workflow
📄️ PDF Templates Gallery
Browse ready-to-use professional templates
📄️ Templates Overview
Learn about template concepts, benefits, and use cases