@kazhord/node-pdf-processor
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

@kazhord/node-pdf-processor

Generate PDF using HTML template and Chrome renderer.

Installation

$ npm install @kazhord/node-pdf-processor

Features

  • Generate PDF from HTML template
  • Beautiful report with CSS
  • Inject dynamic content

API

import { PdfProcessor } from '@kazhord/node-pdf-processor'
[...]
const processor = new PdfProcessor()

Process PDF

const buffer = await processor.process(
            `<!DOCTYPE html>
            <html>
              <head>
                <meta charset="utf-8" />
              </head>
              <body>
                <h1>Test #{{ testNumber }}</h1>
              </body>
            </html>`,
            {
                testNumber: 12345,
            },
            `body {
                background-color: red;
                color: yellow;
            }
            `
        )
/*
<PDF buffer>
*/

Close processor

await processor.stop()

Readme

Keywords

none

Package Sidebar

Install

npm i @kazhord/node-pdf-processor

Weekly Downloads

3

Version

1.0.3

License

MIT

Unpacked Size

9.12 kB

Total Files

9

Last publish

Collaborators

  • aeryax