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

aeropdf-editor

v1.0.1

Published

Modern dark-themed client-side PDF Editor in Javascript

Downloads

298

Readme

AeroPDF Editor

A premium, framework-agnostic, dark-themed client-side PDF editor library. Scoped and encapsulated to allow seamless embedding in any website, dashboard, or JavaScript web application (React, Vue, Angular, Svelte, etc.) without style leaks or global namespace pollution.

Features

  • Modern Dark-Themed UI: Sleek glassmorphism toolbar, responsive sidebar/thumbnail navigation, and smooth micro-animations.
  • Framework Agnostic: Compiles to both ES Modules (dist/aeropdf.es.js) and UMD format (dist/aeropdf.umd.js).
  • In-Place Text Editing: Double-click any existing text in a PDF, change the text, and it masks the original coordinates (with descender/ascender handling) and compiles the replacement text.
  • Smart Font Style Matching: Automatically reads font properties (sans-serif/serif/monospace, bold, italic) from the PDF and uses matching standard PostScript fonts (Helvetica, Times-Roman, Courier) during render and compilation.
  • Signature & Freehand drawing: Draw custom annotations or insert signature pads onto pages.
  • Granular Visibility Controls: Toggle visibility of individual buttons (Download, Print, Zoom, Signature, Rotate, Page Navigation) to fit your application context.
  • API Integration Hooks: Custom lifecycle callback hooks for actions like onSave (delivering compiled Uint8Array bytes) and onPrint.

Installation

Add the library to your project:

npm install aeropdf-editor

Basic Usage

1. Plain HTML / Script Tags (UMD)

Load the stylesheet, library dependencies (PDF.js, PDF-lib, Lucide Icons), and the compiled UMD bundle:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>AeroPDF Editor Embed</title>
  
  <!-- CSS Stylesheet -->
  <link rel="stylesheet" href="node_modules/aeropdf-editor/dist/styles.css">
  
  <!-- Dependencies -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.4.120/pdf.min.js"></script>
  <script src="https://unpkg.com/[email protected]/dist/pdf-lib.min.js"></script>
  <script src="https://unpkg.com/lucide@latest"></script>
  
  <style>
    #editor-viewport {
      width: 100%;
      height: 600px;
    }
  </style>
</head>
<body>

  <!-- Target Container -->
  <div id="editor-viewport"></div>

  <!-- UMD Script -->
  <script src="node_modules/aeropdf-editor/dist/aeropdf.umd.js"></script>
  
  <script>
    document.addEventListener('DOMContentLoaded', () => {
      const container = document.getElementById('editor-viewport');
      
      const editor = new AeroPDFEditor(container, {
        pdfUrl: 'path/to/document.pdf',
        fileName: 'contract_unsigned',
        showSignatureBtn: true,
        onSave: async (pdfBytes) => {
          console.log("Saving PDF bytes...", pdfBytes);
          // Send pdfBytes (Uint8Array) to your server API
        }
      });
    });
  </script>
</body>
</html>

2. React Integration (ES Module)

import React, { useEffect, useRef } from 'react';
import AeroPDFEditor from 'aeropdf-editor';
import 'aeropdf-editor/dist/styles.css';

export default function EmbeddedPDFEditor({ fileBytes }) {
  const containerRef = useRef(null);
  const editorInstance = useRef(null);

  useEffect(() => {
    if (containerRef.current) {
      editorInstance.current = new AeroPDFEditor(containerRef.current, {
        pdfBytes: fileBytes,
        showUploadBtn: false, // Hide uploading custom files
        onSave: async (compiledBytes) => {
          // Send to document API
          await fetch('/api/documents/save', {
            method: 'POST',
            body: compiledBytes,
            headers: { 'Content-Type': 'application/pdf' }
          });
          alert('Saved successfully!');
        }
      });
    }

    return () => {
      if (editorInstance.current) {
        editorInstance.current.destroy();
      }
    };
  }, [fileBytes]);

  return <div ref={containerRef} style={{ width: '100%', height: '80vh' }} />;
}

Options & Configuration

When instantiating new AeroPDFEditor(container, options), you can pass the following properties:

| Option | Type | Default | Description | |---|---|---|---| | pdfUrl | string | null | URL path to fetch the initial PDF. | | pdfBytes | ArrayBuffer / Uint8Array | null | Raw binary bytes of the PDF to render directly from memory. | | fileName | string | 'contract' | Default name for downloaded PDF files. | | showDownloadBtn | boolean | true | Show/hide the Compile & Download button. | | showPrintBtn | boolean | true | Show/hide the Print button. | | showSignatureBtn| boolean | true | Show/hide the Signature pad tool. | | showUploadBtn | boolean | true | Show/hide the Upload PDF option in the menu. | | showClearBtn | boolean | true | Show/hide the Clear Edits option in the menu. | | showSidebarToggle| boolean | true | Show/hide the toggle button for thumbnails sidebar. | | showZoomControls | boolean | true | Show/hide the Zoom In/Out control cluster. | | showFitWidthBtn | boolean | true | Show/hide the Fit Width button. | | showRotateBtn | boolean | true | Show/hide the clockwise Rotation button. | | showAnnotateBtn | boolean | true | Show/hide the drawing/annotation sub-toolbar. | | showHistoryControls| boolean| true | Show/hide the Undo & Redo controls. | | showPageIndicator| boolean | true | Show/hide the page selection inputs. | | onSave | Function | null | Callback triggered when compiling is completed. Receives the compiled PDF Uint8Array as a parameter. | | onPrint | Function | null | Callback hook triggered when clicking Print. |


API Methods

The editor instance exposes the following methods:

  • loadPDF(pdfBytesOrUrl, fileName): Programmatically load or replace the active PDF.
  • getPDFBytes(): Compiles all annotations, signatures, rotations, and inline text edits, returning a Promise resolving to the final Uint8Array.
  • destroy(): Unbinds listeners and destroys references for safe host application component unmount.

License

MIT License. Feel free to use and distribute in personal or commercial projects.