
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@myunisoft/html-to-pdf
Advanced tools
Node lib for converts HTML with dynamic or static content or url to PDF files
Node lib to converts HTML with property binding or url to PDF files.
This package is available in the Node Package Repository and can be easily installed with npm or yarn
$ npm i @myunisoft/html-to-pdf
# or
$ yarn add @myunisoft/html-to-pdf
async function main() {
const browser = await initBrowser();
let readable;
try {
readable = Readable.from(generatePDF(browser, [{ content: html }], pdfOptions));
}
finally {
await terminateBrowser(browser);
}
return readable;
}
main().catch(console.error);
import { initBrowser } from "@myunisoft/html-to-pdf";
const browser = await initBrowser();
Options payload is described by the following TypeScript interface:
import {
LaunchOptions,
BrowserLaunchArgumentOptions,
BrowserConnectOptions,
Product
} from "puppeteer";
type PuppeteerLaunchOptions = LaunchOptions & BrowserLaunchArgumentOptions & BrowserConnectOptions & {
product?: Product;
extraPrefsFirefox?: Record<string, unknown>;
}
files
and options
arguments are described with the following TypeScript interface/type:
interface pdfFile {
content?: string,
url?: string
}
type PuppeteerPDFOptions = PDFOptions & { paginationOffset?: number };
import * as pdf from "@myunisoft/html-to-pdf";
const browser = await pdf.initBrowser();
const pdfOptions = {};
const content = "..HTML HERE..";
const readable = Readable.from(
pdf.generatePDF(browser, [{ content }], pdfOptions)
);
// Do the work with readable (pipe to an http response for example).
import * as pdf from "@myunisoft/html-to-pdf";
const browser = await pdf.initBrowser();
try {
// DO THE WORK HERE
}
finally {
await pdf.terminateBrowser(browser);
}
Thanks goes to these wonderful people (emoji key):
Nicolas Hallaert 💻 📖 ⚠️ | Gentilhomme 🛡️ 👀 📖 | PierreD 💻 |
MIT
FAQs
Node lib for converts HTML with dynamic or static content or url to PDF files
The npm package @myunisoft/html-to-pdf receives a total of 2 weekly downloads. As such, @myunisoft/html-to-pdf popularity was classified as not popular.
We found that @myunisoft/html-to-pdf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
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.