
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
dynamic-html-to-pdf
Advanced tools
dynamic-html-to-pdf is a small package used to create pdf from edge template.
Edge transform edge template into html string.
Playwright transform html string into pdf file.
npm install dynamic-html-to-pdf --save
const pdf = require('dynamic-html-to-pdf')
const template = '/absolute/path/to/file/template.edge'
// Context that can be used inside the views
const context = { users: [{ name: 'John Doe' }, { name: 'Jane Doe' }] }
// Playwright options (https://playwright.dev/docs/api/class-page#page-pdf)
const options = { path: './output.pdf' }
// Folder that contain views (https://edgejs.dev/docs/getting_started#mounting-disks)
const defaultDisk = '/absolute/path/to/file/'
// Function that can be used inside the views (https://edgejs.dev/docs/templates_state#globals)
const globals = { toLowerCase: (string) => string.toLowerCase() }
pdf.create(template, context, options, defaultDisk, globals)
Look https://playwright.dev/docs/api/class-page#page-pdf for different options.
<html>
<head>
<style>
.page {
position: relative;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
@each(user in users)
<div class="page">
{{ toLowerCase(user.name) }}
</div>
@endeach
</body>
</html>
Look https://edgejs.dev/docs/introduction for edge syntax
FAQs
Create dynamic PDF from Edge.js template
The npm package dynamic-html-to-pdf receives a total of 214 weekly downloads. As such, dynamic-html-to-pdf popularity was classified as not popular.
We found that dynamic-html-to-pdf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.