pdfkit

Display and manipulate PDF documents in iOS apps using PDFKit.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/DFly7/iOS-FastAPI-Supabase-AI --skill pdfkit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdfkit
Source: https://github.com/DFly7/iOS-FastAPI-Supabase-AI/tree/main/.agents/skills/pdfkit
Command: npx skills add https://github.com/DFly7/iOS-FastAPI-Supabase-AI --skill pdfkit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provide clear, actionable guidance for displaying, navigating, searching, annotating, and programmatically manipulating PDF documents in iOS apps using PDFKit so developers avoid common pitfalls with PDFView, PDFDocument, and annotation coordinate systems.

Core Features & Use Cases

  • Rendering & Navigation: Configure PDFView display modes, scaling, history navigation, and page destinations for smooth reading experiences.
  • Text Search & Extraction: Find strings synchronously or asynchronously, extract page or region text, and highlight search results for reader interaction and indexing.
  • Annotations & Forms: Create, add, remove, and burn-in annotations; fill form widgets, handle widget state, and implement custom annotation subclasses for stamps or interactive widgets.
  • Integration Patterns: Wrap PDFView in SwiftUI via UIViewRepresentable, implement coordinator patterns for page tracking and annotation hit detection, and generate thumbnails or render pages to images for previews.

Quick Start

Open the PDFDocument from a file URL and assign it to a PDFView configured with autoScales and an appropriate displayMode, or wrap that PDFView in a UIViewRepresentable to show it inside SwiftUI.

Frequently Asked Questions about pdfkit

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

FAQPage Schema
How do I display a PDF document in a SwiftUI view?

To display a PDF document in SwiftUI, wrap PDFKit's PDFView using UIViewRepresentable, assign a loaded PDFDocument, and configure properties like autoScales and displayMode for smooth reading.

How do I extract text and highlight search results from a PDF in iOS?

Extract text and highlight PDF search results in iOS by using PDFKit's synchronous or asynchronous string find methods, then map the matches to page regions for reader interaction and indexing.

Can I fill forms and add annotations to a PDF using PDFKit?

Yes, you can fill forms and add annotations using PDFKit by creating, adding, or removing annotation objects, managing form widget states, and burning in annotations permanently.

Why does my PDFView crash when changing pages or annotations in Swift?

PDFView crashes during page or annotation mutations often occur when modifying the PDFDocument off the main thread; ensure all PDFKit coordinate changes and updates execute safely on the main thread.

Does PDFKit support generating PDF page thumbnails for previews?

Yes, PDFKit supports generating page thumbnails and rendering PDF pages to images, allowing you to create visual previews for reader interaction and document overviews in your iOS app.