New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

convert-reactjs-html-to-pdf

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

convert-reactjs-html-to-pdf

convert-reactjs-html-to-pdf is a React JS library for converting html to printable pdf with high quality and saving it locally.

  • 1.0.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

convert-reactjs-html-to-pdf

📄 convert-reactjs-html-to-pdf is a React JS library for converting html to printable pdf with high quality and saving it locally.

With convert-reactjs-html-to-pdf you can include:

✔️ Images with high quality like logos, barcodes, QR codes, etc.

✔️ Applying external, internal and inline CSS

✔️ Resize PDF on generate

Example:

Installation

Use the package manager npm to install convert-reactjs-html-to-pdf.

npm i convert-reactjs-html-to-pdf

Usage

ℹ️ For best result set width: 600px; and min-height: 840px of desired element or set resize to true

import { reactJsHtmlToPdf } from "convert-reactjs-html-to-pdf";

reactJsHtmlToPdf(element, name, resize, debug);

Options

Required
  • element: (string) - Target HTML element based on document.querySelector(CSS selectors)
    • View all selectors CSS selectors
  • name: (string) - Choose name for the file
Optional, default is false
  • resize: (boolean) - If set to true sets fixed size of A4 (width and min-height). ❗ Targeted element must be responsive for best result ❗
  • debug: (boolean) - If set to true it's open generated PDF in new window for preview without automatically downloading it.

Demo

CSS selectors

License

MIT

Keywords

FAQs

Package last updated on 31 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc