1.0.9 • Published 6 months ago

pup-pdf-react v1.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

pup-pdf-react

This library uses puppeteer and react to generate pdf.

Note: You need to install chromium browser

Just call function generatePdf(data)

data parameter can have following parameters

export interface GeneratePdfInterface {
  footer?: ReactElement<any, string | JSXElementConstructor<any>>;
  header?: ReactElement<any, string | JSXElementConstructor<any>>;
  margin?: PDFMargin;
  content: ReactElement<any, string | JSXElementConstructor<any>>,
  cssFilePath?: string;
  cssAsString?: string;
  destination?: string;
  paperFormat?: PaperFormat
}
type PaperFormats = "LETTER" | "LEGAL" | "TABLOID" | "LEDGER" | "A0" | "A1" | "A2" | "A3" | "A4" | "A5" | "A6" | "Letter" | "Legal" | "Tabloid" | "Ledger"

Example

import generatePdf from "pup-pdf-react"

generatePdf({
    footer: <Footer />,
    header: <Header />,
    content: <Content />,
    cssFilePath: "./css/content.css",
    destination: "pdf/newPdf.pdf"
})
1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago