
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
puppeteer-html2pdf-ts
Advanced tools
puppeteer-html2pdf-ts is a simple and fast library to convert HTML to PDF, using Puppeteer and TypeScript.
puppeteer-html2pdf-ts is easy to use and install. You can install it with
npm install puppeteer-html2pdf-ts
or
yarn add puppeteer-html2pdf-ts
or
pnpm add puppeteer-html2pdf-ts
Example:
const template = fs.readFileSync(path.join(__dirname, "assets/template.html"), "utf-8")
const doc = new htmlToPDF(template)
const pdfBuffer = await doc.create(/*PDF generation options*/)
// Do anything with this Buffer
Using Google fonts:
await doc.addFonts([
{
family: "Comfortaa",
weights: [300, 400, 500, 600, 700]
},
{
family: "Nunito",
weights: [200, 400, 500, 600, 700]
}
])
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
position: relative;
padding: 0;
margin: 0;
font-family: "Nunito", sans-serif;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "Comfortaa", sans-serif;
}
.rect {
top: 0;
position: fixed;
z-index: -1;
width: 50px;
height: 100vh;
background-color: orange;
}
.page_break {
page-break-before: always;
}
.header {
/* position: fixed; */
width: 200px;
/* left: 60px;
top: 20px; */
}
#content {
/* width: 100%; */
/* margin: 60px; */
margin-top: 0;
}
.page {
/* margin-top: 100px; */
}
.footer {
border-top: 1px solid #000;
background-color: #000;
width: 100%;
}
</style>
</head>
<body>
<!-- <div class="rect"></div> -->
<div id="content"></div>
</body>
</html>
FAQs
HTML to PDF Generator for nodejs using puppeteer
The npm package puppeteer-html2pdf-ts receives a total of 6 weekly downloads. As such, puppeteer-html2pdf-ts popularity was classified as not popular.
We found that puppeteer-html2pdf-ts 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.