
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
ejs-html-to-pdf-lite
Advanced tools
Convert HTML or EJS to PDF using Playwright-core with full CSS and design support.
A fast, lightweight, and production-ready alternative to html-pdf
and puppeteer
for converting HTML or EJS templates into high-quality PDFs using playwright-core
, with full design and CSS support.
playwright-core
+ ejs
.ejs
and .html
– dynamic or static usage<style>
and internal CSS fully supportednpm install ejs-html-to-pdf-lite
npx playwright install chromium
const { generatePdf } = require('ejs-html-to-pdf-lite');
// Basic usage with default A4 size
await generatePdf({
inputPath: './templates/example.ejs',
outputPath: './output.pdf',
data: {
name: 'John Doe',
items: [
{ name: 'Product 1', quantity: 2, price: 10.99 },
{ name: 'Product 2', quantity: 1, price: 24.99 }
]
},
type: 'ejs' // or 'html'
});
// With custom paper size
await generatePdf({
inputPath: './templates/example.ejs',
outputPath: './output-letter.pdf',
data: {
name: 'John Doe',
items: [
{ name: 'Product 1', quantity: 2, price: 10.99 },
{ name: 'Product 2', quantity: 1, price: 24.99 }
]
},
type: 'ejs',
paperSize: 'Letter' // Use standard paper size
});
// With custom dimensions
await generatePdf({
inputPath: './templates/example.ejs',
outputPath: './output-custom.pdf',
data: {
name: 'John Doe',
items: [
{ name: 'Product 1', quantity: 2, price: 10.99 },
{ name: 'Product 2', quantity: 1, price: 24.99 }
]
},
type: 'ejs',
paperSize: { width: '8.5in', height: '11in' } // Custom dimensions
});
A0
, A1
, A2
, A3
, A4
(default), A5
, A6
, Letter
, Legal
, Tabloid
, Ledger
width
and height
properties (e.g., { width: '8.5in', height: '11in' }
)npx playwright install chromium
)FAQs
Convert HTML or EJS to PDF using Playwright-core with full CSS and design support.
The npm package ejs-html-to-pdf-lite receives a total of 6 weekly downloads. As such, ejs-html-to-pdf-lite popularity was classified as not popular.
We found that ejs-html-to-pdf-lite demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.