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

@openworkbook/pdf

v0.2.2

Published

Direct, vector, text-selectable PDF export for @openworkbook/core workbooks (browser and Node.js, no print dialog, no headless browser)

Readme

@openworkbook/pdf

Direct PDF export for OpenWorkbook workbooks: a vector, text-selectable PDF of one sheet, several sheets or the whole workbook, in the browser and in Node.js (Next.js route handlers, Server Actions), with no print dialog, no headless browser and no canvas. Dependencies: @openworkbook/core and fflate. MIT.

import { exportPdf, pdfResponse, downloadPdf } from '@openworkbook/pdf';

const bytes = exportPdf(workbook, { sheets: 'all', title: 'Q3 report' });   // Uint8Array
export async function GET() { return pdfResponse(book, 'report.pdf'); }     // Next.js route handler
downloadPdf(workbook, 'report.pdf');                                        // browser

In the Studio: <Studio pdf={pdf} /> with import * as pdf from '@openworkbook/pdf' enables File, Export to PDF.

What it does

  • Same pages as printing: each sheet's page setup (paper, orientation, margins, scale and fit to page, print areas, print titles, manual page breaks, page order, centring, first page number, gridlines, headings, black and white, draft) through core's layoutPrintPages, the pagination of the print helpers and Print Preview.
  • Same drawing as the grid: cells are painted by a page painter that follows the grid's rules and reuses its helpers; charts, shapes, text effects, pictures (PNG, JPEG, SVG; GIF, WebP and BMP are converted to PNG in a browser by the asynchronous export), barcodes, slicers, timelines, ink and sparklines are drawn by the grid's ObjectPainter through a PDF implementation of the canvas 2D context, so they stay vector.
  • Text: the 14 standard PDF fonts with their metrics when no font file is given; embedded TrueType / OpenType fonts as subset CID fonts with ToUnicode maps (selectable and searchable), fallback fonts for missing characters, bidi reordering and Arabic shaping. Characters no font can draw are reported, never dropped silently.
  • Document: clickable cell and object links (web and internal), one bookmark per sheet, document properties, header / footer codes with formatting and pictures (&G), odd / even / first-page headers and footers, notes and comments (as displayed or at the end), optional AES-256 encryption (PDF 2.0 security handler, user / owner passwords, permissions).
  • Warnings for everything that is approximated or left out.

Documentation

Tests

pnpm test runs the unit tests (writer, encryption with known-answer tests of SHA-2 and AES, fonts and subsetting with a synthetic TrueType font, bidi and Arabic shaping, pagination equality with sheetPrintLayout, page geometry for every paper size, header / footer codes, links, pictures, Unicode, options). test/oracle.local.test.ts additionally opens the output with PyMuPDF, poppler (pdftotext, pdfinfo) and Ghostscript (and, on macOS, PDFKit for encrypted files) and extracts the text back with real fonts when those tools and fonts are installed; it skips otherwise.