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

pdfdancer-react

v0.1.9

Published

A React-based Canvas renderer for PDF-like operator streams with XML upload capabilities.

Downloads

49

Readme

PDFDancer Frontend

A React-based Canvas renderer for PDF-like operator streams with XML upload capabilities.

Overview

PDFDancer Frontend is a sophisticated PDF rendering engine that processes XML-formatted PDF operator streams and renders them on HTML5 Canvas. The application supports interactive debugging, font analysis, and element visualization.

Features

  • XML Upload & Processing: Upload and parse XML files containing PDF operator streams
  • Canvas-based Rendering: High-performance Canvas rendering with support for complex PDF operations
  • Interactive Debugging: Toggle debug mode with element bounds visualization
  • Font Analysis: Comprehensive font information and resolution tracking
  • Multi-page Support: Navigate through multi-page documents
  • Live Preview: Real-time rendering updates with debugging capabilities

Tech Stack

  • Frontend: React 18 with functional components and hooks
  • Rendering: HTML5 Canvas with custom PDF operator implementation
  • Build: Rollup for library builds, CRACO for development
  • Testing: Jest with React Testing Library
  • XML Parsing: SAX parser for efficient XML processing
  • Logging: Configurable log levels with loglevel

Development

Prerequisites

  • Node.js (version specified in package.json peer dependencies)
  • npm or yarn

Installation

npm install

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build library for distribution
  • npm run build:app - Build standalone application
  • npm test - Run test suite
  • npm run lint - Run ESLint
  • npm run lint:fix - Fix ESLint issues automatically
  • npm run cli - Run PDF renderer CLI tool
  • npm run xml-roundtrip - XML roundtrip testing utility

Project Structure

src/
├── components/          # React components
├── rendering/           # Canvas rendering engine
├── parsers/            # XML and data parsers
├── models/             # Data models and structures
├── services/           # Business logic services
├── util/               # Utility functions
├── cli/                # Command-line interface
└── test/               # Test files and utilities

Key Components

  • PDFDancer: Main rendering component with Canvas integration
  • XMLUploader: File upload and XML parsing interface
  • Rendering Engine: Core PDF operator stream processor
  • Font Resolution: Advanced font handling and caching system

Usage

As a Library

import PDFDancer from 'pdfdancer-react';

// Use PDFDancer component in your React application
<PDFDancer
  xmlContent={xmlData}
  onError={handleError}
  onFontInfo={handleFontInfo}
  debugMode={true}
  showElementBounds={false}
/>

CLI Tool

npm run cli -- [options] input.xml

Configuration

Debug mode can be enabled through:

  • Environment variables (see src/util/env.js)
  • Runtime toggle in the application interface
  • CLI flags for command-line usage

Testing

The project includes comprehensive test coverage for:

  • Rendering engine components
  • XML parsing and validation
  • Font resolution systems
  • Canvas operations
  • Regression testing with visual comparisons

Run tests with:

npm test

Contributing

  1. Follow the existing code style and conventions
  2. Run tests before submitting changes
  3. Use the linting tools to maintain code quality
  4. Check the test results and regression comparisons

License

Private package - see package.json for details.