🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@koukitsuko/html2pdf.js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koukitsuko/html2pdf.js

Client-side HTML-to-PDF rendering using pure JS

0.11.0
latest
Source
npm
Version published
Weekly downloads
10
150%
Maintainers
1
Weekly downloads
 
Created
Source

@koukitsuko/html2pdf.js

A fork of html2pdf.js with modern build tooling and improved HTML rendering.

Changes from the original

This fork makes the following improvements to the original html2pdf.js:

  • Replaces html2canvas with html2canvas-pro for improved HTML rendering
  • Uses modern build tooling to provide ESM, CommonJS, and UMD builds
  • Simplified package structure for easier use in modern JavaScript environments

Installation

# Using npm
npm install @koukitsuko/html2pdf.js

# Using pnpm
pnpm add @koukitsuko/html2pdf.js

Usage Examples

import html2pdf from '@koukitsuko/html2pdf.js';

// Generate PDF from element
const element = document.getElementById('element-to-print');
html2pdf().from(element).save('my-pdf.pdf');

CommonJS

const html2pdf = require('@koukitsuko/html2pdf.js');

// Generate PDF from element
const element = document.getElementById('element-to-print');
html2pdf().from(element).save('my-pdf.pdf');

Documentation

For detailed API documentation, options, and advanced usage, please refer to the original html2pdf.js documentation.

Development

Build Commands

# Install dependencies
pnpm install

# Build development version
pnpm run dev

# Build production version
pnpm run build

Building and Contributing

  • Clone the repository
  • Install dependencies with pnpm install
  • Make changes to files in the src directory
  • Build with pnpm run build
  • Test your changes
  • Submit a pull request

Credits

This project is a fork of html2pdf.js by Erik Koopmans.

License

The MIT License

Copyright (c) 2017-2019 Erik Koopmans <http://www.erik-koopmans.com/>

Keywords

javascript

FAQs

Package last updated on 10 Apr 2025

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