Skip to content

Conversation

@Toxiapo
Copy link
Collaborator

@Toxiapo Toxiapo commented Apr 7, 2025

This PR updates the file prop type to align with react-pdf, allowing the consumer app to choose a different downloading strategy. By default, when the file prop is provided as a URL string, React-pdf will download and render the PDF content in chunks.

Additionally, I've added a new route, Fetch PDF URL - Webpub, which eliminates the need to construct a TOC for the manifest, this step will eventually be handled by the backend. I’ve also added a custom getContent function to return a URL string to replace the default function that is currently returns Uinit8Array.

Tested on a 1.2G linearized PDF:

Before:
Before
After:
After

…atch the `file` props used for rendering the pdf
@Toxiapo Toxiapo changed the title Refactor the return type of the getContent function on PdfReader to m… SFR-2592: Update <Document> type to support File type from react-pdf Apr 7, 2025
Copy link
Collaborator

@jackiequach jackiequach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just some minor non-blocking comments

Copy link
Contributor

@kristojorg kristojorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@oliviawongnyc oliviawongnyc removed their request for review June 30, 2025 14:31
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.

4 participants