RORK LABJP
FUNDING — Rork's $15M seed was led by Left Lane Capital with Peak XV, True Ventures, Goodwater, and a16z SpeedrunGROWTH — Rork keeps growing with 743K monthly visits and an 85% growth rateMAX — Rork Max generates native Swift apps for iPhone, iPad, Watch, TV, Vision Pro, and iMessageMAX — It reaches HealthKit, Core ML, and Dynamic Island — territory React Native struggles withMARKET — Apple pushes agentic coding in Xcode 27, accelerating AI-driven native developmentMARKET — Gartner projects 75% of new apps will be low-code or no-code by the end of 2026FUNDING — Rork's $15M seed was led by Left Lane Capital with Peak XV, True Ventures, Goodwater, and a16z SpeedrunGROWTH — Rork keeps growing with 743K monthly visits and an 85% growth rateMAX — Rork Max generates native Swift apps for iPhone, iPad, Watch, TV, Vision Pro, and iMessageMAX — It reaches HealthKit, Core ML, and Dynamic Island — territory React Native struggles withMARKET — Apple pushes agentic coding in Xcode 27, accelerating AI-driven native developmentMARKET — Gartner projects 75% of new apps will be low-code or no-code by the end of 2026
Articles/App Dev
App Dev/2026-07-03Intermediate

Adding PDF Viewing and Export to a Rork Max App — When to Use PDFKit vs. ImageRenderer

Implement PDF viewing, search, and export in Rork Max's native Swift with PDFKit. Covers UIGraphicsPDFRenderer vs. ImageRenderer trade-offs, password protection, and share sheet integration.

rork-max39pdfkitswift8imagerendererpdf-export

Premium Article

Running an app with a notes feature, I started receiving the same request over and over: "Can I send my notes as a PDF?" As an indie developer, I initially assumed piping plain text into the share sheet was enough. But for people using the app to keep work records, a properly formatted PDF isn't a nicer version of text — it's a deliverable, and text doesn't substitute for it.

Because Rork Max generates native Swift, you get PDFKit — which ships with the OS — for free. Viewing, search, and export all work without adding a single dependency, and that's the biggest practical difference from a React Native setup. In this article I'll walk through working code for viewing, exporting, password protection, and sharing.

Why Handle PDFs in Rork Max (Native Swift)?

With React Native Rork, your options are third-party libraries or WebView rendering for display, and HTML-bridge approaches like expo-print for generation. They work, but I kept running into limits around dependency maintenance and fine-grained layout control.

ApproachViewingSearch / AnnotationGenerationExtra Dependency
WebView (RN)△ basic display onlyNo
react-native-pdf etc. (RN)△ depends on libraryYes
expo-print (RN)△ via HTMLYes
PDFKit (Rork Max / native)◯ with UIGraphicsPDFRendererNo (bundled with OS)

For a solo developer, not adding dependencies is itself a maintenance win. Being able to lean on the OS-standard framework for everything PDF-related is one of the concrete payoffs of choosing native generation.

A practical Rork Max prompt to start from looks like this:

Add a screen where saved notes can be viewed and exported as PDF.
Use PDFKit's PDFView for display and UIGraphicsPDFRenderer for export,
and make the result shareable via the share sheet.

With the generated code as a base, let's go through each building block and where you'll want to intervene.

Displaying with PDFView — a Minimal SwiftUI Wrapper

The heart of PDFKit is PDFView. It's a UIKit view, so you wrap it in UIViewRepresentable:

import SwiftUI
import PDFKit
 
struct PDFViewer: UIViewRepresentable {
    let url: URL
 
    func makeUIView(context: Context) -> PDFView {
        let view = PDFView()
        view.autoScales = true                 // fit to screen width
        view.displayMode = .singlePageContinuous
        view.usePageViewController(true)       // page-swipe feel
        view.document = PDFDocument(url: url)
        return view
    }
 
    func updateUIView(_ uiView: PDFView, context: Context) {
        if uiView.document?.documentURL != url {
            uiView.document = PDFDocument(url: url)
        }
    }
}

The first thing that trips people up is autoScales. Forget it and the PDF renders at its natural size — a tiny speck in the corner of the screen. Generated code sometimes omits it, so if your PDF looks minuscule, check this first.

PDFDocument(url:) lazy-loads pages, so even a several-hundred-page document opens quickly. Reading the whole file into Data and using PDFDocument(data:), on the other hand, spikes memory on large files. For local files, I recommend the URL initializer.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A minimal SwiftUI wrapper for PDFView, plus the autoScales setup detail that trips people up first
Clear criteria for choosing between UIGraphicsPDFRenderer and ImageRenderer (pagination, resolution, implementation cost)
Password-protected export and share sheet integration, with the production pitfalls I actually hit
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

App Dev2026-07-02
Using MusicKit in Rork Max Native Swift — Apple Music Authorization, Search, and Playback in a Minimal Setup
Bringing MusicKit into a Rork Max Swift app: MusicAuthorization, catalog search with MusicCatalogSearchRequest, choosing between ApplicationMusicPlayer and SystemMusicPlayer, and handling non-subscribers with previews and offers.
App Dev2026-04-04
Rork Max × Foldable iPhone 2026 — App Design Strategy for the Folding Screen Era
Multiple supply chain sources indicate a foldable iPhone is coming in late 2026. Here's how to use Rork Max and SwiftUI adaptive layouts to get your app ready now — before the device ships.
AI Models2026-07-02
Integrating Image Playground in Rork Max Native Swift — Availability Design and Fallbacks for In-App Image Generation
How to build Image Playground into a Rork Max Swift app: availability checks with supportsImagePlayground, the imagePlaygroundSheet modifier, programmatic generation with ImageCreator, and fallback design for unsupported devices.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →