Socket
Socket
Sign inDemoInstall

smart-pdf-generator

Package Overview
Dependencies
73
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    smart-pdf-generator

Generate beautiful pdf with Handlebars on NodeJS


Version published
Weekly downloads
13
decreased by-55.17%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@bsight/smart-pdf-generator

Smart PDF Generator

Installation

$ npm i smart-pdf-generator

Features

  • Export beautiful Handlebars templates to PDF in one command
  • Save PDF to file

Basic usage

const smartPDF = require("smart-pdf-generator");

let people = ["Arthur", "Julie", "Martin"];
let hbsTemplatePath = "./templates/people-list.handlebars";

// =>  Generate PDF
const pdf = smartPDF.generatePDF(hbsTemplatePath, { people });

// =>  Save to file
smartPDF.savePDFToFile(pdf, "./exports/myAwesomePDF.pdf");

It is also possible to use options as a third argument of generatePDF function where you pass everything in a single object. The list of options is listed below.

Options

  • format Format of the exported PDF, A4 by default
  • printBackground Print images that are on the template background or not, true by default

Keywords

FAQs

Last updated on 18 Oct 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc