@easypdf/react
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 β€’ Public β€’ Published

EasyPdf React

EasyPdf Logo

EasyPdf React

Free and open source React library for generating beautiful PDFs from React components

Features

  • 🎨 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

Installation

npm install @easypdf/react
# or
yarn add @easypdf/react

Quick Start

import { EasyPdfProvider, EasyPdf } from "@easypdf/react";

// Initialize EasyPdf
const easyPdf = EasyPdf.initialize();

function App() {
  return (
    <EasyPdfProvider instance={easyPdf}>
      <YourApp />
    </EasyPdfProvider>
  );
}

Basic Usage

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>
  );
}

Documentation

Visit our documentation for detailed guides and examples.

Examples

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Author

Acknowledgments

Special thanks to all our contributors and the open source community.

Package Sidebar

Install

npm i @easypdf/react

Weekly Downloads

219

Version

1.1.2

License

MIT

Unpacked Size

2.31 MB

Total Files

20

Last publish

Collaborators

  • easypdf