pdfstudio-core-pdfjs-pdflib-bridge

Bridge PDF.js rendering and pdf-lib editing with coordinate transforms.

1|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/Open-PDF-Studio-Claude-Skill-Package --skill pdfstudio-core-pdfjs-pdflib-bridge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdfstudio-core-pdfjs-pdflib-bridge
Source: https://github.com/OpenAEC-Foundation/Open-PDF-Studio-Claude-Skill-Package/tree/main/skills/source/pdfstudio-core/pdfstudio-core-pdfjs-pdflib-bridge
Command: npx skills add https://github.com/OpenAEC-Foundation/Open-PDF-Studio-Claude-Skill-Package --skill pdfstudio-core-pdfjs-pdflib-bridge

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Bridge the rendering and editing paths for PDFs by connecting PDF.js and pdf-lib, preventing byte-level desyncs and coordinate mismatches during load and save.

Core Features & Use Cases

  • Dual-parse bridge: PDF.js for rendering and pdf-lib for editing, sharing a single source of truth via an originalBytesCache.
  • Coordinate system alignment: CropBox-based transforms and Y-axis inversion ensure annotation positions are preserved between app and PDF coordinates.
  • Color extraction and form persistence: uses a dedicated bridge to fill in missing color data and to copy AnnotationStorage values into pdf-lib forms.
  • Use Case: when editing or annotating PDFs, this bridge keeps the visible rendering and the edited bytes aligned, reducing corruption risks.

Quick Start

Load a PDF in Open PDF Studio and use the bridge to keep rendering and editing synchronized from load to save.

Frequently Asked Questions about pdfstudio-core-pdfjs-pdflib-bridge

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep PDF.js rendering and pdf-lib editing in sync without byte-level desyncs?

To keep PDF.js rendering and pdf-lib editing in sync, use a dual-parse bridge that shares a single source of truth via an originalBytesCache, preventing byte-level desyncs during load and save operations.

Why do my PDF annotation positions shift when saving after editing with pdf-lib?

PDF annotation positions shift during save due to coordinate mismatches between app and PDF coordinate systems. Applying CropBox-based transforms and Y-axis inversion ensures annotation positions are preserved between rendering and editing.

What is the best way to extract missing color data and persist form fields across PDF.js and pdf-lib?

The best way to extract missing color data and persist form fields is using a dedicated bridge to copy AnnotationStorage values into pdf-lib forms, ensuring form-field persistence across both libraries.

Does the PDF.js and pdf-lib bridge cache buffers independently for safe parsing?

Yes, the PDF.js and pdf-lib bridge enforces safe buffer caching and independent parsing to maintain a single source of truth, preventing corruption risks when loading, editing, and saving PDFs.

When do I need CropBox-based coordinate transforms for PDF annotations?

You need CropBox-based coordinate transforms for PDF annotations when aligning the visible rendering coordinates from PDF.js with the editing coordinates in pdf-lib, ensuring robust handling of annotation positions during load and save.

Can I use this PDF bridge to prevent byte-level corruption when annotating PDFs?

Yes, you can use this PDF bridge to prevent byte-level corruption when annotating by keeping the visible rendering and edited bytes aligned through safe buffer caching and independent parsing throughout the editing workflow.