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

@siliph/pdf-engine-core

v0.3.0

Published

Browser-native PDF parser, renderer, and editor engine. Merge, split, rotate, crop, encrypt, sign, annotate, and edit PDFs entirely client-side with zero server dependencies.

Downloads

80

Readme


Install

npm install @siliph/pdf-engine-core

Quick Start

import { mergePdfs, splitPdf, rotate, fillForm, search } from '@siliph/pdf-engine-core';

// Merge PDFs
const merged = await mergePdfs([doc1, doc2]);

// Split by page ranges
const parts = await splitPdf(doc, [{ start: 0, end: 4 }, { start: 5, end: 9 }]);

// Rotate page 90°
const cmd = await rotate(doc, 0, 90);
if (cmd.ok) doc.applyCommand(cmd.value);

// Fill form
const formCmd = await fillForm(doc, { name: 'John', agree: true });

// Full-text search
for await (const hit of search(doc, 'invoice')) {
  console.log(`Page ${hit.pageIndex}, offset ${hit.offset}`);
}

Tree Shaking

Each task is independently importable — no bundle bloat:

import { mergePdfs } from '@siliph/pdf-engine-core/tasks/mergePdfs'; // ~15KB gzipped

20 Task Functions

| Function | Description | |----------|-------------| | mergePdfs | Merge multiple documents into one | | splitPdf | Split by page ranges | | splitByBookmarks | Split at bookmark boundaries | | splitBySize | Split into max-size chunks | | extractPages | Extract specific pages | | rotate | Rotate pages (90°/180°/270°) | | crop | Crop (metadata or content clip) | | compress | Remove unused resources (GC) | | addWatermark | Add text watermark to all pages | | setHeaderFooter | Add headers/footers with page numbers | | setMetadata | Set title, author, keywords | | redact | Visual or permanent redaction | | fillForm | Fill AcroForm fields | | search | Full-text search (Unicode NFC, async iterator) | | mixPages | Alternate pages from multiple docs | | addBackPages | Insert back pages for duplex printing | | setBookmarks | Set document outline | | getBookmarks | Read current bookmarks | | pdfToImages | Convert pages to PNG/JPEG |

14 Engines

| Engine | Capability | |--------|-----------| | Parser | XRef streams, object streams, lazy loading, brute-force recovery | | Rendering | Canvas2D, OffscreenCanvas Workers, blend modes, transparency groups | | Font | TrueType, Type1, CID, CMap, ToUnicode, glyph LRU cache, Standard 14 | | Text | Run reconstruction, in-place editing, kerning, RTL/BiDi, selection | | Image | JPEG, JPEG2000, JBIG2, CCITTFax, Flate, SMask compositing | | Annotation | 9 types, appearance streams, visual + permanent redaction | | Forms | AcroForms, all field types, validation, radio groups | | Security | RC4, AES-128, AES-256, digital signatures (PKCS#7) | | Page | Merge, split, extract, rotate, crop, reorder, resource dedup | | Export | Incremental save, full save, streaming, Worker offload | | Search | Unicode NFC, ligature decomposition, hyphenation, async iterator | | Selection | Hit-testing (4px tolerance), multi-select, marquee | | Graphics | Shape primitives, ink paths | | Validation | PDF/A-1b conformance checking |

Benchmarks

| Operation | Time | Memory | |-----------|------|--------| | Parse XRef (500pg, 12MB) | ~85ms | 4MB | | First page render | ~180ms | 28MB | | Merge 100pg + 50pg | ~45ms | 18MB | | Full-text search (200pg) | ~120ms | 6MB | | AES-256 decrypt (5MB) | ~95ms | 8MB | | Incremental save | ~35ms | 12MB |

Error Handling

All functions return Result<T, TaskError> — never throws:

const result = await mergePdfs([doc1, doc2]);
if (result.ok) {
  console.log(result.value.getPageCount());
} else {
  console.error(result.error.code);    // 'INVALID_INPUT' | 'ENGINE_FAILURE'
  console.error(result.error.message);
}

Part of @siliph/pdf-engine

| Package | Description | |---------|-------------| | @siliph/pdf-engine | Umbrella (re-exports all) | | @siliph/pdf-engine-core | Parser, engines, task API (this package) | | @siliph/pdf-engine-ui | Viewport, toolbar, accessibility | | @siliph/pdf-engine-plugin-sdk | Plugin extension system |

Links

License

MIT