pdflib-syntax-pages

Manage PDF pages with pdf-lib's PageSizes enum and PDFDocument APIs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Simplifies and standardizes page management in pdf-lib by providing a complete PageSizes enum and reliable page operation methods, preventing common sizing mistakes across add, insert, and remove actions.

Core Features & Use Cases

  • Supports addPage, insertPage, removePage, getPage, getPages, and page size awareness through PageSizes.
  • Ensures correct coordinate systems, rotation, and content transformations for consistent document layouts.
  • Use Case: build multi-page PDFs with varied sizes (A4, Letter, custom) while guaranteeing stable indices and shapes.

Quick Start

Create a new PDFDocument and start with PageSizes.A4, then experiment with insertPage, removePage, and getPage to manage pages.

Frequently Asked Questions about pdflib-syntax-pages

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

FAQPage Schema
How do I add a new page to a pdf-lib document with a specific page size like A4?

You can add pages with specific dimensions in pdf-lib by passing the PageSizes enum directly to the addPage or insertPage methods, which guarantees accurate sizing and correct coordinate systems for your document layout.

How do I insert a page at a specific index in a multi-page pdf-lib workflow?

You can insert a page at a specific index in pdf-lib using the insertPage method, which manages the PDFDocument and PDFPage APIs to ensure deterministic, correctly-indexed page management across your multi-page workflow.

Does pdf-lib support querying and modifying page rotations and page boxes?

Yes, pdf-lib supports querying and modifying page rotations and page boxes through the PDFPage API, allowing you to manage coordinate systems and content transformations for consistent document layouts.

What is the best way to remove a page from a pdf-lib document without breaking existing page indices?

The best way to remove a page without breaking indices in pdf-lib is using the removePage method, which standardizes page management and ensures stable indices and shapes for remaining pages in the multi-page workflow.

Can I use custom page sizes when adding pages to a pdf-lib PDFDocument?

Yes, you can use custom page sizes when adding pages to a pdf-lib PDFDocument by defining dimensions manually or leveraging the PageSizes enum alongside addPage and insertPage to prevent common sizing mistakes.

Why does my pdf-lib inserted page have incorrect sizing or coordinate transformations?

Incorrect sizing or coordinate transformations usually occur when bypassing the PageSizes enum; using standardized addPage and insertPage methods ensures correct page boxes, rotations, and coordinate systems for reliable layouts.