This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@iqx-limited/quick-pdf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
QuickPDF
Handling PDFs in NodeJS (📃 to 🖼️)
This project provides a set of utilities for converting various file formats without the need for additional dependencies. It supports multiple file types and leverages technologies like Playwright, PDFKit, and pdfjs-dist for file processing.
Features
HTML to PDF: Converts HTML content (from a URL or file path) into a PDF.
Image to PDF: Converts images (JPEG, PNG) into a PDF, with optional headers and footers.
PDF to Image: Converts PDF files to image formats (JPEG or PNG) using pdfjs-dist and canvas.
Utilities: Includes helper functions to fetch and read HTML files and read files from local directories.
Requirements
Node.js: This project is built with Node.js and uses ES modules. NodeJS > v22 required.
Operations Available in the Package
1. html2pdf
Function Signature:
html2pdf(input:string|URL)
Parameters:
Parameter
Type
Description
Data that can be passed
input
string | URL
The HTML content to convert to PDF.
A file path or a URL pointing to HTML content, as either a Node URL object or a Node string. Alternativly pass an html string directly.
base64
string?
Return a base64 encoded string instead of a buffer