
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
generate-pdf-from-react-html
Advanced tools
generate-pdf-from-react-html is a React JS library for converting html to printable pdf with high quality and saving it locally.
📄 generate-pdf-from-react-html is a React JS library for converting html to printable pdf with high quality and saving it locally.
With generate-pdf-from-react-html you can include:
✔️ Images with high quality like logos, barcodes, QR codes, etc.
✔️ Applying external, internal and inline CSS
✔️ Resize PDF on generate
Use the package manager npm to install generate-pdf-from-react-html.
npm i generate-pdf-from-react-html
import { pdfFromReact } from "generate-pdf-from-react-html";
pdfFromReact(element, name, resize, debug);
ℹ️ For best result and preview set width: 600px;
and min-height: 840px
of desired element or set resize
to true
❗ In order CSS to work correctly, targeted element must be selected at top level in your style file, for example:
#CSS
.element-for-print {
width: value;
height: value;
etc...
}
#SCSS
.element-for-print {
width: value;
height: value;
etc...
}
#CSS
.parent-element .element-for-print {
width: value;
height: value;
etc...
}
#SCSS
.parent-element{
.element-for-print {
width: value;
height: value;
etc...
}
}
element: (string)
- Target HTML element based on document.querySelector(CSS selectors)
name: (string)
- Choose name for the filefalse
resize: (boolean)
- If set to true
sets fixed size of A4 (width and min-height) on generate. ❗ 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.FAQs
generate-pdf-from-react-html is a React JS library for converting html to printable pdf with high quality and saving it locally.
The npm package generate-pdf-from-react-html receives a total of 90 weekly downloads. As such, generate-pdf-from-react-html popularity was classified as not popular.
We found that generate-pdf-from-react-html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.