pdflib-core-architecture

Official

Write correct, async-aware pdf-lib code

AuthorOpenAEC-Foundation
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Provides authoritative, version-aware guidance to avoid the most common and critical pdf-lib mistakes — forgetting to await async operations, using the wrong coordinate origin, mis-embedding fonts, and incorrect cross-document page handling — so developers produce reliable PDF code across environments.

Core Features & Use Cases

  • Library architecture & lifecycle: Clear create/load/configure/draw/save patterns and the distinction between async embeds and sync drawing operations.
  • Font and image rules: When and how to register fontkit, prefer custom fonts for Unicode, and embed only PNG/JPEG images with correct scaling.
  • Coordinate system & layout patterns: Bottom-left origin guidance, top-aligned positioning using page height, and common page sizes and defaults.
  • Practical use case: Author code that creates an A4 document, registers fontkit, embeds a TTF font, draws a header and images with proper sizing, and saves the output without runtime errors.

Quick Start

Create a new A4 PDF with pdf-lib 1.x, register fontkit before embedding any TTF, embed the font, draw a top-aligned header using page height for positioning, and save the PDF while awaiting all async embed and save calls.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: pdflib-core-architecture
Download link: https://github.com/OpenAEC-Foundation/pdf-lib-Claude-Skill-Package/archive/main.zip#pdflib-core-architecture

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.