@asaje/pdf-generator
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

pdf-generator

Easy pdf generator from HTML based on puppeteer.

Installation

npm i @asaje/pdf-generator

or

yarn add @asaje/pdf-generator

Usage

import { generatePdf, PrintPdfOptions } from '@asaje/pdf-generator';

async function generate(data: { html: string; options: PrintPdfOptions }) {
  const path = randomUUID() + '.pdf';
  const pdfBuffer = await generatePdf({
    html: data.html,
    options: { ...data.options, path },
  });
}

Readme

Keywords

none

Package Sidebar

Install

npm i @asaje/pdf-generator

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

2.61 kB

Total Files

5

Last publish

Collaborators

  • asaje379