pdflib-impl-pdf-generation

Generate paginated PDF documents with pdf-lib 1.x from structured content.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Prevents content overflow, misplaced elements, and incorrect positioning when building complete PDF documents (invoices, reports, certificates, and templates) using pdf-lib by providing proven patterns for pagination, headers/footers, tables, and asset embedding.

Core Features & Use Cases

  • Multi-page generation patterns that track Y position and add new pages when content overflows.
  • Header/footer stamping and accurate page numbering applied after content generation.
  • Table-like layout primitives, centered text helpers, and guidance on embedding fonts and images efficiently.
  • Use Case: Generate an invoice or multi-page report from structured JSON, embed fonts/images once, paginate rows, and then stamp headers, footers, and totals on every page.

Quick Start

Use this skill to generate a multi-page invoice PDF from structured data with correct pagination, embedded fonts and images, and headers/footers applied after all pages are created.

Frequently Asked Questions about pdflib-impl-pdf-generation

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

FAQPage Schema
How do I generate multi-page PDFs from structured JSON without content overflow?

You generate multi-page PDFs by tracking the manual Y-position and adding new pages when rows exceed the layout boundary. Content overflow is prevented by paginating rows dynamically and stamping headers, footers, and totals after all pages are generated.

How do I apply headers and footers with correct page numbers in pdf-lib?

To apply headers and footers in pdf-lib, generate all document content first, then stamp the header and footer elements onto the pages. This post-generation approach ensures accurate page numbering across the entire multi-page document.

Why does my embedded image or text get misplaced when adding a new page in pdf-lib?

Images and text get misplaced when manual Y-position pagination is not tracked correctly. You prevent incorrect positioning by calculating layout boundaries, embedding fonts and images once, and creating new pages only when content exceeds the current page height.

Does pdf-lib support async font and image embedding for multi-page invoices?

Yes, pdf-lib 1.x supports async font and image embedding for generating multi-page invoices. You embed PNG and JPEG assets once efficiently, then use table-like layout primitives and centered text helpers to structure the invoice rows.

What is the best way to build a paginated table layout for an invoice in pdf-lib?

The best way to build a paginated table layout is to use table-like layout primitives that track the Y-position. You iterate through structured invoice data, add new pages when the row exceeds the boundary, and stamp totals on the final page.

When should I not use manual pagination for PDF generation?

You should reconsider manual pagination if your document is strictly a single page, as tracking Y-positions and post-generating header/footer stamps are designed to prevent overflow specifically in multi-page layouts like reports and certificates.