All Projects → diegomura → React Pdf

diegomura / React Pdf

Licence: mit
📄 Create PDF files using React

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Pdf

Graphicsrenderer
A drop-in UIGraphicsRenderer port -- CrossPlatform, Swift 4, Image & PDF
Stars: ✭ 85 (-99.16%)
Mutual labels:  renderer, pdf
Sentinl
Kibana Alert & Report App for Elasticsearch
Stars: ✭ 1,233 (-87.86%)
Mutual labels:  pdf
Magicodes.ie
Import and export general library, support Dto import and export, template export, fancy export and dynamic export, support Excel, Csv, Word, Pdf and Html.
Stars: ✭ 1,198 (-88.2%)
Mutual labels:  pdf
Reactime
Chrome extension for improving and optimizing performance in React applications (Gatsby and Next.js compatible).
Stars: ✭ 1,219 (-87.99%)
Mutual labels:  renderer
Trace Of Radiance
An educational raytracer
Stars: ✭ 77 (-99.24%)
Mutual labels:  renderer
Deerlet
[Deprecated] A markdown online-editable-resume with pdf generator
Stars: ✭ 79 (-99.22%)
Mutual labels:  pdf
Personal Goals
List of books I've read, projects I've done, videos I've seen, articles I've read or podcasts I've listened to.
Stars: ✭ 75 (-99.26%)
Mutual labels:  flexbox
Fe Necessary Book
A book and software collection about frontend
Stars: ✭ 1,239 (-87.8%)
Mutual labels:  pdf
Flutter plugin pdf viewer
A flutter plugin for handling PDF files. Works on both Android & iOS
Stars: ✭ 81 (-99.2%)
Mutual labels:  pdf
Cheatsheets
JavaScript and Node.js cheatsheets
Stars: ✭ 1,191 (-88.27%)
Mutual labels:  pdf
Flycube
Graphics API wrapper is written in C++ on top of Directx 12 and Vulkan. Provides main features including ray tracing.
Stars: ✭ 78 (-99.23%)
Mutual labels:  renderer
Markdownmonster
An extensible Markdown Editor, Viewer and Weblog Publisher for Windows
Stars: ✭ 1,203 (-88.15%)
Mutual labels:  pdf
Jfbview
PDF and image viewer for the Linux framebuffer.
Stars: ✭ 78 (-99.23%)
Mutual labels:  pdf
Pyhanko
pyHanko: sign and stamp PDF files
Stars: ✭ 77 (-99.24%)
Mutual labels:  pdf
Word2pdf Tools
📝通过LibreOffice / WPS / Microsoft Office / 第三方库 实现多种word转pdf格式的方案
Stars: ✭ 82 (-99.19%)
Mutual labels:  pdf
Azuredevops.wikipdfexport
Export Azure DevOps Wiki to PDF
Stars: ✭ 76 (-99.25%)
Mutual labels:  pdf
Pandoc Letter Din5008
Pandoc template for writing Markdown letters (DIN 5008)
Stars: ✭ 77 (-99.24%)
Mutual labels:  pdf
Laravel Pdf
A Simple package for easily generating PDF documents from HTML. This package is specially for laravel but you can use this without laravel.
Stars: ✭ 79 (-99.22%)
Mutual labels:  pdf
Koreader Base
Base framework offering a Lua scriptable environment for creating document readers
Stars: ✭ 81 (-99.2%)
Mutual labels:  pdf
Puppeteer Pdf
PDF generation wrapper for Elixir using Puppeteer
Stars: ✭ 82 (-99.19%)
Mutual labels:  pdf

React renderer for creating PDF files on the browser and server

New react-pdf 2.0 was released. Read about the announcement

Lost?

This package is used to create PDFs using React. If you wish to display existing PDFs, you may be looking for react-pdf.

How to install

yarn add @react-pdf/renderer

Webpack 5

Webpack 5 doesn't include node shims automatically anymore and we must opt-in to all shims we want. To do this we have to add a few dependencies to our project:

yarn add process browserify-zlib stream-browserify util buffer assert

after the modules are installed, we need to adjust our webpack.config file:

const webpack = require("webpack");

module.exports = {
  /* ... */

  resolve: {
    fallback: {
      process: require.resolve("process/browser"),
      zlib: require.resolve("browserify-zlib"),
      stream: require.resolve("stream-browserify"),
      util: require.resolve("util"),
      buffer: require.resolve("buffer"),
      asset: require.resolve("assert"),
    }
  },
  plugins: [
    new webpack.ProvidePlugin({
      Buffer: ["buffer", "Buffer"],
      process: "process/browser",
    }),
  ]

  /* ... */
}

How it works

import React from 'react';
import { Document, Page, Text, View, StyleSheet } from '@react-pdf/renderer';

// Create styles
const styles = StyleSheet.create({
  page: {
    flexDirection: 'row',
    backgroundColor: '#E4E4E4'
  },
  section: {
    margin: 10,
    padding: 10,
    flexGrow: 1
  }
});

// Create Document Component
const MyDocument = () => (
  <Document>
    <Page size="A4" style={styles.page}>
      <View style={styles.section}>
        <Text>Section #1</Text>
      </View>
      <View style={styles.section}>
        <Text>Section #2</Text>
      </View>
    </Page>
  </Document>
);

Web. Render in DOM

import 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 file

import React from 'react';
import ReactPDF from '@react-pdf/renderer';

ReactPDF.render(<MyDocument />, `${__dirname}/example.pdf`);

Contributors

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.

Sponsors

Thank you to all our sponsors! [Become a sponsors]

Backers

Thank you to all our backers! [Become a backer]

License

MIT © Diego Muracciole

FOSSA Status


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].