pdflib-errors-common

Diagnose pdf-lib runtime and rendering errors in JavaScript and TypeScript workflows.

1|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/pdf-lib-Claude-Skill-Package --skill pdflib-errors-common
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdflib-errors-common
Source: https://github.com/OpenAEC-Foundation/pdf-lib-Claude-Skill-Package/tree/main/skills/source/pdflib-errors/pdflib-errors-common
Command: npx skills add https://github.com/OpenAEC-Foundation/pdf-lib-Claude-Skill-Package --skill pdflib-errors-common

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Rapidly identify and fix the most frequent pdf-lib mistakes that cause blank pages, misplaced content, missing images/fonts, form errors, and runtime exceptions in JavaScript/TypeScript PDF workflows. The Skill consolidates a prioritized diagnostic checklist and targeted remedies so developers can stop guessing and produce correct pdf-lib code faster.

Core Features & Use Cases

  • Diagnostic Checklist: Step-by-step checks for forgotten await, coordinate origin confusion, unsupported image formats, cross-document page copy rules, case-sensitive form field names, and color value ranges.
  • Decision Tree & Examples: A decision tree for common failure modes plus runnable before/after examples that demonstrate each fix.
  • Reference API Signatures: Quick lookup of async vs synchronous methods, drawing parameter names, save options, and recommended safeguards for form appearances and blank-page prevention.
  • Use Case: Debug a script that outputs a blank PDF or places text in the wrong vertical position by following the checklist to find missing awaits, coordinate math, or incorrect embed calls.

Quick Start

Point me at the failing pdf-lib code or describe the PDF symptom (blank page, mispositioned content, image/form error) and I will run the diagnostic checklist and recommend fixes.

Frequently Asked Questions about pdflib-errors-common

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

FAQPage Schema
Why does my pdf-lib script output a blank PDF page?

A blank PDF page in pdf-lib is typically caused by missing await on async operations like embedJpg, save, or copyPages. Running the diagnostic checklist verifies async usage and ensures save options like addDefaultPage are correctly configured.

How do I fix text or images appearing in the wrong position in pdf-lib?

Misplaced text or images in pdf-lib happen when bottom-left coordinate origin conversions are applied incorrectly. The diagnostic checklist helps correct vertical coordinate math to position content precisely on the PDF canvas.

What image formats does pdf-lib support for embedding?

pdf-lib supports embedding PNG and JPEG images only. Attempting to embed unsupported image formats causes runtime failures, so the diagnostic checklist enforces PNG/JPEG-only embedding rules to prevent image embedding errors.

How do I resolve form field issues when using pdf-lib?

Form field issues in pdf-lib often stem from case-sensitive form field names or missing updateFieldAppearances in save options. The diagnostic checklist identifies case mismatches and applies recommended save safeguards to fix form rendering.

Does pdf-lib support copying pages across different PDF documents?

Yes, pdf-lib supports cross-document page copying using copyPages, but incorrect async handling or copyPages semantics causes runtime exceptions. The checklist verifies correct await usage and copy logic for cross-document PDF workflows.

What causes runtime exceptions during pdf-lib save operations?

Runtime exceptions during pdf-lib save operations are frequently caused by missing await on the save method or invalid save options. The diagnostic checklist targets forgotten awaits and validates save parameters to resolve JavaScript PDF rendering errors.