npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@benpley/wappler-html2pdf

v1.0.4

Published

Convert HTML to PDF using headless Chrome in Wappler Server Connect

Readme

HTML to PDF Server Connect Module

This module enables converting HTML content to PDF files server-side within your Wappler NodeJS projects, powered by Puppeteer. It is suitable for generating documents, reports, invoices, or any printable content in PDF format.

Features

  • Convert any HTML content to a PDF file
  • Many configuration options for PDF output
  • Page size, margin, landscape/portrait, and background print control
  • Header and footer templates
  • Wait-for-selector and timing options for dynamic content
  • Save output to a file (custom path or temp) or use for immediate download

Configuration Options

The module supports the following settings:

HTML Content

  • html (required): The HTML string to be converted into PDF

PDF Output

  • filename: Set a filename for the PDF (default: document.pdf)
  • path: Set a save path for the PDF file (optional)

Page Settings

  • format: Page format (A4, A3, A5, Letter, Legal, Tabloid) (default: A4)
  • landscape: Use landscape orientation (default: false)
  • printBackground: Print background graphics (default: true)
  • scale: Webpage rendering scale (0.1 to 2; default: 1)

Margins

  • marginTop, marginRight, marginBottom, marginLeft: Set page margins (e.g., 10mm, 1in)

Header and Footer

  • displayHeaderFooter: Toggle header/footer rendering
  • headerTemplate: HTML template for the header
  • footerTemplate: HTML template for the footer

Advanced

  • preferCSSPageSize: Use CSS page size if defined
  • waitForSelector: Wait for a CSS selector before generating PDF (optional)
  • waitTime: Wait additional ms before PDF generation (default: 0)

For all options, both static values and server data bindings are supported.

Dependency

The module uses the Puppeteer Node package. Make sure it is installed (version ^22.0.0).

Usage

  1. Add the HTML to PDF step in your Server Connect workflow.
  2. Configure required and optional properties as above.
  3. Trigger your Server Connect API from your frontend to generate/download the PDF.

Example Use Case

Generate an invoice or report from your dynamic HTML content and either serve it for download or save it to a folder (e.g., uploads/pdfs/invoice.pdf).

Issues and Support

For bug reports, feature requests, or assistance, please use the Wappler Community Forum.


Second release. Feedback welcome!