Skip to content

Support local PDFs without react-native-blob-util - #1051

Open
savv wants to merge 2 commits into
wonday:masterfrom
savv:codex/local-pdf-without-blob-util
Open

savv wants to merge 2 commits into
wonday:masterfrom
savv:codex/local-pdf-without-blob-util

Conversation

@savv

@savv savv commented Oct 19, 2026 •

Copy link
Copy Markdown

Adds react-native-pdf/local for apps that prepare local PDFs with Expo FileSystem or another file API, without installing Blob Util.
The local entry point shares the existing native renderer, PDF callbacks and page commands, and never copies or deletes caller-owned files.
The default import retains its existing download, cache, asset, base64 and transformation behavior; Blob Util is optional only for local-only consumers.
Two commits: extract the shared renderer, then add the local API, package metadata, types and usage docs. No CI or test-tooling changes.

  • Tested locally: eight component/dependency-graph checks, packed-package TypeScript usage, and RN 0.88 iOS/Android Metro release bundles with Blob Util absent.
  • Test: on iOS/Android, open a local PDF, zoom, follow a link, navigate via its outline and setPage(), switch documents, close and reopen; the original files should remain intact.
  • Native device rendering has not been run for this PR; local JavaScript tests replace the native boundary. Native renderer source is unchanged.

savv added 2 commits October 19, 2026 10:39
Move the existing render methods, native event handlers, defaults and initial view state into PdfRenderer. The existing Pdf component inherits the renderer and retains its Blob Util loading, caching, transformation and cleanup code.
Expose react-native-pdf/local for callers that prepare their own files with Expo FileSystem or another filesystem. Keep the default entry point and its source handling intact. Mark Blob Util as an optional peer, isolate the local dependency graph, preserve native renderer callbacks and page commands, and leave file lifetime with the caller.
@savv
savv force-pushed the codex/local-pdf-without-blob-util branch from ec34ce6 to 10a7f14 Compare October 19, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant