pdflib-impl-page-layout

Provide top-down layout helpers for pdf-lib PDF pages in JavaScript or TypeScript.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Prevents the most common pdf-lib layout mistakes by teaching top-down positioning for a bottom-left coordinate system, enforcing margins, and detecting page overflow so content does not appear in the wrong place or get clipped.

Core Features & Use Cases

  • Coordinate awareness: Clear guidance for working with pdf-lib's bottom-left origin to avoid inverted Y-axis errors when placing text, images, and shapes.
  • Margin and content area management: Patterns for defining content regions, header/footer placement, and consistent spacing across pages.
  • Flow and pagination: CursorY pattern, overflow checks, and page-break logic to render multi-page documents, multi-column layouts, tables, and captioned images reliably.
  • Measurement-first approach: Emphasizes measuring text and image dimensions to center elements and estimate wrapped text height before advancing the cursor.

Quick Start

Create a multi-page PDF using pdf-lib with margin-aware top-down flow, centered headers, measured text sizing, and automatic page breaks.

Frequently Asked Questions about pdflib-impl-page-layout

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

FAQPage Schema
How do I position text and images top-down in pdf-lib without Y-axis inversion?

To position content top-down in pdf-lib, you must translate coordinates from the top margin using the page's bottom-left origin. This Skill provides layout helpers that automatically invert the Y-axis, preventing inverted or clipped text and images.

How do I estimate wrapped text height and manage pagination in pdf-lib?

Estimating wrapped text height in pdf-lib requires measuring text dimensions before advancing a layout cursor. This Skill implements a CursorY pattern with margin-aware overflow detection to trigger automatic page breaks for multi-page document flow.

Does pdf-lib support margin-aware multi-column layouts and centering?

pdf-lib supports multi-column layouts and centering by manually defining content regions and measuring element dimensions. This Skill provides helpers to enforce consistent margins, calculate centering, and manage spacing across multiple columns.

What's the best way to prevent content from clipping or overflowing on a pdf-lib page?

The best way to prevent content clipping in pdf-lib is to perform overflow checks before drawing by measuring text and image dimensions. This Skill enforces margin-aware boundaries and page-break logic to ensure content stays within the defined area.

Can I use this pdf-lib layout approach for multi-page tables and captioned images in JavaScript?

Yes, you can use this approach for multi-page tables and captioned images in JavaScript or TypeScript projects using pdf-lib 1.x. It provides the necessary pagination logic and measurement-first sizing to render complex document flows reliably.