react-pdf

Generate PDFs from React projects using React-PDF components.

14|1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/wpgaurav/WordPress-skills --skill react-pdf-wpgaurav
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-pdf
Source: https://github.com/wpgaurav/WordPress-skills/tree/main/skills/frontend/react-pdf
Command: npx skills add https://github.com/wpgaurav/WordPress-skills --skill react-pdf-wpgaurav

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Generate PDFs directly from React projects using the React-PDF library to enable on-device document creation without server-side rendering.

Core Features & Use Cases

  • Generate Documents: create PDFs for reports, invoices, forms, and other printable content within React apps.
  • Local Fonts: ensure all fonts are loaded from local files to avoid remote fetch issues and ensure consistent rendering.
  • Layout & Styling: compose documents with Document, Page, View, Text, StyleSheet, and Svg components to control structure and visuals.
  • Real-World Use Case: produce a client invoice or project report directly in the browser or in a React-powered admin panel.

Quick Start

Install React-PDF in your project and render a simple Document with a Page, Text, and View to generate your first PDF.

Frequently Asked Questions about react-pdf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate PDFs in React without server-side rendering?

You can generate PDFs in React without server-side rendering by using the React-PDF library to create documents directly on the client device. This approach enables on-device document creation for reports, invoices, and forms.

How do I load local fonts in React-PDF to avoid remote fetch issues?

To load local fonts in React-PDF and avoid remote fetch issues, you must import fonts from local files. Additionally, you should disable hyphenation for custom fonts to ensure consistent and reliable document rendering.

Can I use React-PDF to generate invoices and reports in a web dashboard?

Yes, you can use React-PDF to generate printable content like invoices, receipts, and project reports directly within web apps, dashboards, and admin panels. It composes documents using Document, Page, View, and Text components.

Why does my custom font break PDF rendering in React?

Custom font PDF rendering in React breaks when fonts are fetched remotely or when hyphenation is enabled. To ensure reliable rendering, load all fonts from local files, wrap async code in an IIFE, and disable hyphenation.

What is the best way to structure a printable document in a React app?

The best way to structure a printable document in a React app is using React-PDF's layout components. You compose documents with Document, Page, View, Text, StyleSheet, and Svg components to control the visual structure of your PDF.

Do I need a backend to create PDF documents in a React frontend project?

No, you do not need a backend to create PDF documents in a React frontend project. React-PDF enables on-device document creation directly in the browser, eliminating the need for any server-side rendering.