Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vencakrecl/pdf-generator

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vencakrecl/pdf-generator

Package for convert HTML to PDF by headless Chrome.

  • 1.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

PDF Generator

NPM package version License Last test status

Package for convert HTML to PDF by headless Chrome (puppeteer).

  • JSON schema validation (ajv)
  • Template engine (pug)
  • CSS (bootstrap)
  • HTTP server for static files (expressjs)

Installation

npm install @vencakrecl/pdf-generator
yarn add @vencakrecl/pdf-generator

Demo

make run-demo
make run-demo-api ## HTTP server running on localhost:3001

Example

import { PdfGenerator } from '@vencakrecl/pdf-generator'

const createPdf = async () => {
  const pdf = new PdfGenerator('base_dir')
  await pdf.start()

  pdf.addTemplate('test', 'template.pug', {
    properties: {
      title: {
        type: 'string'
      }
    },
    required: ['title']
  })

  const data = await pdf.generate('test', {title: 'Title'})

  console.log(data)

  await pdf.stop()
}

createPdf()

Keywords

FAQs

Package last updated on 06 Jul 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc