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 🙏

© 2025 – Pkg Stats / Ryan Hefner

wf-jspdf

v1.2.0

Published

A library for generating whatsfresh PDF documents using jsPDF

Downloads

401

Readme

wf-jsPDF

Create common format for Whatsfresh PDF Reports

pdfBundle

A versatile library for generating Whatsfresh PDF reports with customizable headers, tables, and data pivoting.

Note: This library incorporates the jsPDF and jsPDF-autotable libraries for rendering PDF documents

Table of Contents

Installation

Installing the library using npm:

npm install pdfBundle

Installing in Appsmith:

  1. Navigate to the Libraries icon
  2. Click the plus (+) button
  3. Install the latest version (for instance https://cdn.jsdelivr.net/npm/[email protected]/dist/index.umd.js)
  • Note: You can try installing https://cdn.jsdelivr.net/npm/wf-jspdf@latest/dist/index.umd.js but sometimes there's a lag.

Usage

Here's how you can use the pdfBundle to generate a PDF:

const hdrData = { acctName: 'Whatsfresh Account Name', 
                  title: '1st Part of 2nd Line', 
                  name: '2nd Part of 2nd Line', 
                  description: 'Either hard coded or rendered from data' };
const tblData = { [
    {
      "Code": "M",
      "Ingredient": "Mango",
      "gms/Oz": 22,
      "Units": "Pound",
    },
    {
      "Code": "P",
      "Ingredient": "Peach",
      "gms/Oz": 21,
      "Units": "Pound",
    },
    {
      "Code": "SB",
      "Ingredient": "Strawberry",
      "gms/Oz": 18,
      "Units": "Pound",
    }
  ] };

// Generate Report Header
var result = pdfBundle.genHeader(hdrData.acctName, hdrData.title, hdrData.name, hdrData.description);

// Generate Table Header
const hdrText = 'Table Header';
result = pdfBundle.genTblHeader(result.doc, hdrText, result.finalY);

// Generate Table
result = pdfBundle.genTable(result.doc, tblData, result.finalY);

// Export PDF
result.doc.save('example.pdf');

Note: You can generate multiple tables as needed.

Functions Overview

It is assumed that ALL Whatsfresh PDF documents will have a Report Header

var result = pdfBundle.genHeader(doc, acctName, title, name, descr)

Generates a header for the PDF.

Parameters:

acctName: Whatsfresh account to display at the top of the Report Header

title: The 1st part of the 2nd line of the Report Header.

name: The 2nd part of the 2nd line of the Report Header. Bolded

descr: A free flowing description in italic style.

Returns:

An object containing the created doc and finalY position to be used for startY position of the next element.

Examples

Contributing

License