react-pdf
Installation
SKILL.md
Generating PDFs with React-PDF
CRITICAL REQUIREMENTS
- Fonts MUST be local files - Remote font URLs (http/https) do NOT work. Always download fonts to local files before using them.
- Wrap async code in IIFE - Top-level await causes errors. Always use
(async () => { ... })()pattern. - Disable hyphenation for custom fonts - Custom fonts lack hyphenation dictionaries and may
crash or break words incorrectly. Always call
Font.registerHyphenationCallback((word) => [word]);after registering custom fonts.
Files
references/google-fonts.txt- Metadata for ~65 popular Google Fonts with TrueType URLs. Each line is a font variant in tab-separated format:font name,style,category,weight,url.references/components.md- Full component API reference and supported CSS propertiesassets/example-template.tsx- Minimal working example demonstrating fixed footers, page numbers, and unbreakable content. Read this before starting to understand the basic patterns. Note: not all