openaec-foundation/frappe_claude_skill_package/frappe-syntax-print
Claude Code and agent skill by openaec-foundation/frappe_claude_skill_package
- community
Checking that the SKILL.md file is still in the repository.
Use when creating print formats or generating PDFs in Frappe v14-v16. Covers Jinja print formats, Print Designer [v15+], Letter Head, PDF generation API (get_pdf, download_pdf), Report print formats ({%= %} syntax), page breaks, and print CSS patterns. Prevents common mistakes with template engine confusion and PDF rendering. Keywords: print format, PDF, get_pdf, Jinja, Letter Head, print designer,, PDF not generating, print format broken, custom PDF, letter head, wkhtmltopdf error. wkhtmltopdf, WeasyPrint, page-break, download_pdf.
Install
npx vskill@latest install openaec-foundation/frappe_claude_skill_package/frappe-syntax-printSKILL.md
The same SKILL.md was published earlier as openaec-foundation/frappe_claude_skill_package/frappe-syntax-print.
Frappe Print Formats & PDF Generation
Deterministic reference for print formats, Letter Head, and PDF generation in Frappe v14/v15/v16.
When to Use This Skill
USE when:
- Creating or modifying Print Formats (Jinja or JS)
- Generating PDFs programmatically (
get_pdf, download endpoints) - Configuring Letter Head (header/footer) for print output
- Working with Print Designer (v15+)
- Implementing page breaks, print CSS, or landscape layouts
- Building Report Print Formats ({%= %} syntax)
DO NOT USE for:
- General Jinja template syntax (emails, portals) -- see
frappe-syntax-jinja - Client Script UI logic -- see
frappe-syntax-clientscripts - Web views or portal pages -- see
frappe-syntax-jinja
Decision Tree: Which Print Format Type?
Print Format Types
| Type | Engine | Version | When to Use | |
|---|---|---|---|---|
| Standard | Auto from DocType field layout | v14+ | No customization needed | |
| Jinja | Server-side Jinja2 (wkhtmltopdf) | v14+ | Full layout control | |
| JS Template | Client-side microtemplate | v14+ | Report print formats only | |
| Print Designer | WeasyPrint / Chrome | v15+ | Visual drag-and-drop builder |
Standard Print Format
ALWAYS the default. Frappe auto-generates layout from DocType fields. No code needed. Controlled via Print Settings and field print_hide property.
Jinja Print Format
Set custom_format = 1 on the Print Format document. Full Jinja2 with server-side rendering.
Context variables available in every Jinja Print Format:
| Variable | Type | Content | |
|---|---|---|---|
doc | Document | The document being printed | |
meta | Meta | DocType metadata | |
layout | list | Field layout sections | |
letter_head | str | Rendered Letter Head HTML | |
footer | str | Rendered footer HTML | |
print_settings | dict | Print Settings configuration | |
frappe | module | Full frappe module access |
Example — Minimal Jinja Print Format:
JS Template (Report Print Formats)
ONLY for Query Reports and Script Reports. Uses {%= %} microtemplate syntax, NOT Jinja.
CRITICAL: NEVER mix Jinja {{ }} and JS {%= %} syntax. They are completely separate template engines.
Print Designer (v15+ Only)
- Separate app:
bench get-app print_designer - Uses WeasyPrint (not wkhtmltopdf)
- Visual drag-and-drop builder in the browser
- NEVER attempt to use Print Designer on v14 -- it does not exist
Letter Head
Letter Head provides consistent header/footer across all print formats.
Configuration
| Field | Purpose | |
|---|---|---|
source | "Image" or "HTML" | |
content | Header HTML (Jinja-rendered with doc context) | |
footer | Footer HTML (Jinja-rendered, PDF only) | |
image | Header image (when source = "Image") | |
align | Image alignment: Left, Center, Right |
IMPORTANT: The footer field only displays in PDF output, never in browser print preview.
Letter Head in Jinja Templates
Dynamic Letter Head Content
Letter Head content and footer fields support Jinja with doc context:
PDF Generation API
Seereferences/pdf-api.mdfor complete API reference.
Quick Reference
Download Endpoints
PDF Engine Selection (v15+)
| Engine | When | Config | |
|---|---|---|---|
| wkhtmltopdf | Default on v14, fallback on v15+ | Default | |
| Chrome | v15+ with Chromium installed | pdf_generator = "chrome" on Print Format | |
| WeasyPrint | Print Designer formats only | Automatic for Print Designer |
ALWAYS use wkhtmltopdf on v14. On v15+, Chrome produces better CSS3 support.
Page Breaks & Print CSS
Page Break Classes
Print CSS Classes (Frappe Built-in)
| Class | Effect | |
|---|---|---|
.print-format | Container: max-width 8.3in, min-height 11.69in (A4 portrait) | |
.print-format.landscape | Width 11.69in (A4 landscape) | |
.page-break | page-break-after: always | |
.print-heading | Print title styling | |
.hidden-pdf | Hidden in PDF output only | |
.visible-pdf | Visible in PDF output only |
PDF Header/Footer HTML
Print CSS Best Practices
Custom App Print Formats
Ship a Print Format with Your App
In the JSON file, ALWAYS set:
ALWAYS set standard = "Yes" and module for app-shipped print formats. This ensures they are recognized as part of the app and not as site-level customizations.
Jinja Filters for Print Formats
| Filter | Purpose | Example | ||
|---|---|---|---|---|
global_date_format | Format date per system settings | `{{ doc.posting_date \ | global_date_format }}` | |
json | Serialize to JSON string | `{{ doc.items \ | json }}` | |
len | Get length | `{{ doc.items \ | len }}` | |
int | Cast to integer | `{{ value \ | int }}` | |
flt | Cast to float | `{{ value \ | flt }}` | |
markdown | Render Markdown to HTML | `{{ doc.description \ | markdown }}` | |
abs | Absolute value | `{{ value \ | abs }}` |
Register Custom Jinja Filters/Methods
Version Compatibility Matrix
| Feature | v14 | v15 | v16 | |
|---|---|---|---|---|
| Jinja Print Formats | Yes | Yes | Yes | |
| JS Report Templates | Yes | Yes | Yes | |
| Standard Print Formats | Yes | Yes | Yes | |
| Letter Head (Image/HTML) | Yes | Yes | Yes | |
| wkhtmltopdf | Default | Fallback | Fallback | |
| Chrome PDF engine | No | Yes | Yes | |
| WeasyPrint | No | Yes | Yes | |
| Print Designer app | No | Yes | Yes | |
pdf_header_html hook | Yes | Yes | Yes | |
download_multi_pdf | Yes | Yes | Yes |
Common Anti-Patterns
Seereferences/anti-patterns.mdfor the complete list with fixes.
- NEVER use
{{ }}in Report Print Formats -- they use{%= %}(JS microtemplate) - NEVER call
frappe.get_doc()inside a{% for %}loop in templates -- causes N+1 queries - NEVER put heavy business logic in Jinja templates -- move to Python and pass results
- NEVER hardcode page dimensions in CSS -- use
.print-formatclass or relative units - NEVER ignore the
no_letterheadparameter when generating PDFs programmatically - NEVER use Print Designer on v14 -- it requires v15+
- NEVER embed large base64 images in print templates -- use URLs with
max-width: 100%
Reference Files
- Jinja Print Formats -- Jinja syntax, variables, filters, macros
- PDF API -- get_pdf(), download endpoints, page breaks, hooks
- Anti-Patterns -- Common print format mistakes with fixes
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/source/syntax/frappe-syntax-print/SKILL.md
Popularity
- Repository stars
- 88
- Repository forks
- 25
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 29 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/openaec-foundation/frappe_claude_skill_package/frappe-syntax-print)