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

easy-html-to-pdf

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-html-to-pdf

Convert and render HTML files easily to a PDF file

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33
decreased by-52.17%
Maintainers
1
Weekly downloads
 
Created
Source

easy-html-to-pdf

Upto the date lib for creating pdf files using HTML, internally using updated version of puppeteer for smooth integration.

Install

npm install --save dmarc-solution

How to use

Generate PDF with HTML Content

const pdf = require("easy-html-to-pdf").PDFGenerator;

const options = {
  format: "A4", //allowed formats - 'letter', 'legal', 'tabloid', 'ledger', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6'
  headerTemplate: "<p></p>",
  footerTemplate: "<p></p>",
  displayHeaderFooter: false,
  margin: {
    top: "40px",
    bottom: "100px",
    right: "0px",
    left: "0px",
  },
  landscape: false,
  printBackground: true,
  path: "test.pdf", //only required field
};

pdf.convertToPdf("<h1>Hello world</h1>", options);

Keywords

FAQs

Package last updated on 27 Jul 2022

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