📄 Create PDF files using React
React renderer for creating PDF files on the browser and server
This package is used to create PDFs using React. If you wish to display existing PDFs, you may be looking for react-pdf.
yarn add @react-pdf/renderer…Web. Render in DOMimport React from 'react';
import ReactDOM from 'react-dom';
import { PDFViewer } from '@react-pdf/renderer';
const App = () => (
<PDFViewer>
<MyDocument />
</PDFViewer>
);
ReactDOM.render(<App />, document.getElementById('root'));Node. Save in a fileimport React from 'react';
import ReactPDF from '@react-pdf/renderer';
ReactPDF.render(<MyDocument />, `${__dirname}/example.pdf`);This project exists thanks to all the people who contribute. Looking to contribute? Please check our [contribute] document for more details about how to setup a development environment and submitting code.
Thank you to all our sponsors! [Become a sponsors]
Thank you to all our backers! [Become a backer]
MIT © Diego Muracciole
Expose textkit's excludeRects on <Text> (and fix an off-by-one in layoutParagraph's line widths)
@react-pdf/renderer crashes when used via external package in Next.js App Router (monorepo)
Node build can't render once bundled: pdfkit reads its standard fonts from disk next to its own module
Spaces at the beginning of strings are not rendering for <Text /> components
Display Chinese Characters Vertically
JPEG buffer mutated in place during EXIF parsing: corrupts orientation across renders in long-lived processes
<Text render={...}> content disappears when an ancestor has lineHeight set
Add panning and zooming on the playground, so you understand how to do it
Active fork of fontkit
Unable to set flexShrink to 0