- π¨ Visual Mode: Design PDFs using React components with real-time preview
- π Programmatic Mode: Generate PDFs dynamically with programmatic content creation
- π Rich Text Support: Full support for text formatting, lists, tables, and more
- πΌοΈ Image Support: Include images in your PDFs with automatic optimization
- π― Page Breaking: Smart page breaking algorithm for optimal content flow
- π Styling: Full CSS support including flexbox and grid layouts
- π Themes: Built-in themes and support for custom themes
- π Headers & Footers: Customizable headers and footers
- π§ Watermarks: Add text or image watermarks
- π± Responsive: Adapts to different page sizes and orientations
- β‘οΈ Non-Blocking: Smooth PDF generation that doesn't freeze the browser UI
npm install @easypdf/react
# or
yarn add @easypdf/react
import { EasyPdfProvider, EasyPdf } from "@easypdf/react";
// Initialize EasyPdf
const easyPdf = EasyPdf.initialize();
function App() {
return (
<EasyPdfProvider instance={easyPdf}>
<YourApp />
</EasyPdfProvider>
);
}
import { useEasyPdf } from "@easypdf/react";
function PDFGenerator() {
const { pdfRef, downloadPDF } = useEasyPdf();
return (
<div>
<button onClick={() => downloadPDF(pdfRef)}>Download PDF</button>
<div ref={pdfRef}>
<h1>Hello, PDF!</h1>
<p>This content will be converted to PDF.</p>
</div>
</div>
);
}
Visit our documentation for detailed guides and examples.
- Basic Usage
- Visual Mode
- Programmatic Mode
- Custom Styling
- Headers and Footers
- Watermarks
- Page Breaking
- Tables
- Images
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- π Documentation
- π Issues
- Alperen KaravelioΔlu (@alpovka)
Special thanks to all our contributors and the open source community.