
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
nodejs-pdf-report
Advanced tools
Nodejs export pdf report from base html templates!
npm install --save nodejs-pdf-report
import { HtmlReport, ReportOptions } from "nodejs-pdf-report";
const reportOptions: ReportOptions = {
title: "Test report with chartjs",
useChartJs: true,
pdfOptions: {
margin: {
top: "100px",
bottom: "200px",
right: "30px",
left: "30px",
},
},
template: "template.ejs",
headerTemplate: "header-template.ejs",
footerTemplate: "footer-template.ejs",
styles: [
"styles.css"
],
scripts: [
"utils.js",
"index.js",
],
data: {
users: [
{
name: "Luong Phung",
},
{
name: "Jasmine",
},
],
title: "Test report with chartjs",
author: "Luong Phung",
time: "2020",
},
};
const htmlReport = new HtmlReport();
const reportPdf = await htmlReport.createPdf(reportOptions);
const savePath = path.resolve("./chartjs_report.pdf");
fs.writeFileSync(savePath, reportPdf, "binary");

| Name | type | default | Description |
|---|---|---|---|
| scale | number | 1 | Scale of the webpage rendering |
| printBackground | boolean | false | Print background graphics. |
| landscape | boolean | false | Paper orientation |
| format | string | "A4" | Page format as : "Letter" "A0" ... "A4" ... |
| margin | {top, bottom, left, right} | {0, 0, 0, 0} | Page margin as number of pixels |
| Name | type | default | Description |
|---|---|---|---|
| title | string | null | Pdf report title |
| useChartJs | boolean | false | Use chartjs as default |
| pdfOptions | PdfOptions | null | any |
| template | string | null | Template path |
| footerTemplate | string | null | Footer template path |
| headerTemplate | string | null | Header template path |
| styles | string[] | [] | Style paths |
| scripts | string[] | [] | Scripts paths |
| data | object | {} | Report data |
nodejs-pdf-report is released under the MIT license.
FAQs
nodejs server export pdf from base html template
We found that nodejs-pdf-report 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.