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

@ozh1n/pdfkit

v0.1.0

Published

Client-side .pptx and .xlsx to PDF conversion — no server required

Downloads

61

Readme

pdfkit-client

Client-side .pptx and .xlsx → PDF conversion. No server. No uploads. Pure browser.

npm version


Why

Every other solution either requires a server, sends your files to a third party, or is abandonware. This library runs entirely in the browser using the File API, JSZip, and jsPDF.

Trade-off you should know about: Fidelity is ~70-80% on complex files. Charts, advanced animations, and exotic fonts won't transfer. Simple-to-moderate presentations and spreadsheets work well.


Install

npm install @ozh1n/pdfkit jszip jspdf

Or via CDN:

<script src="https://unpkg.com/jszip/dist/jszip.min.js"></script>
<script src="https://unpkg.com/jspdf/dist/jspdf.umd.min.js"></script>
<script src="https://unpkg.com/@ozh1n/pdfkit/dist/index.umd.js"></script>

Usage

Basic

import { toPDF } from 'pdfkit-client'

const input = document.querySelector('input[type="file"]')
input.addEventListener('change', async () => {
  const file = input.files[0]
  const result = await toPDF(file)

  if (result.ok) {
    result.pdf.download('output.pdf')   // triggers browser download
  } else {
    console.error(result.error)
  }
})

With options

const result = await toPDF(file, {
  pages:       [0, 1, 2],       // only first 3 pages/sheets
  pageNumbers: true,            // add page numbers
  title:       'My Document',  // PDF metadata
})

Access the PDF as a Blob (for upload, preview, etc.)

const result = await toPDF(file)
if (result.ok) {
  const blob    = result.pdf.toBlob()      // Blob
  const dataUrl = result.pdf.toDataUrl()   // base64 string for <iframe src>
}

Inspect the Intermediate Representation

import { toIR } from 'pdfkit-client'

const ir = await toIR(file)
if (ir.ok) {
  console.log(ir.doc.pages.length, 'pages')
  console.log(ir.doc.pages[0].elements)   // all parsed elements
}

Supported formats

| Format | Support | Notes | |--------|---------|-------| | .pptx | ✅ | Text, images, shapes, tables | | .xlsx | ✅ | Cell data, basic styles, multiple sheets | | Charts | ⚠️ planned v0.2 | | | Animations | ❌ never | PDF is static | | Complex formulas | ⚠️ values only | Formula results are preserved |


Architecture

File (.xlsx / .pptx)
    ↓
JSZip → unzip in memory
    ↓
Format Parser → Intermediate Representation (IR)
    ↓
PDF Generator (jsPDF) → PDF Blob
    ↓
Download / Blob / DataURL

The IR is a format-neutral data model. This separation means:

  • Parsers are independently testable
  • You can write custom renderers (e.g. HTML preview, PNG export)
  • The public toIR() API lets you build on top of the parsed data

Contributing

git clone https://github.com/aryan1jain2/pdfkit
npm install
npm run dev      # demo app at localhost:5173
npm test         # unit tests
npm run build    # produces dist/

PRs welcome, especially for:

  • Chart rendering
  • Better font substitution
  • PPTX theme colour resolution
  • Merged cell support in XLSX

License

MIT