Skip to content

ws: use hayro for elite pdf experience#3938

Merged
Parth merged 10 commits intomasterfrom
hayro-poc
Nov 11, 2025
Merged

ws: use hayro for elite pdf experience#3938
Parth merged 10 commits intomasterfrom
hayro-poc

Conversation

@Parth
Copy link
Copy Markdown
Member

@Parth Parth commented Nov 7, 2025

this PR rebuilds our PDF experience from the ground up, solving some key problems along the way.

Using a pure rust pdf renderer means that some systemic issues caused by lb-pdf go away:

While here I also solved some other problems:

  • fixes navigate pdfs via keyboard #3386
  • our previous pdf rendering did not re-render upon zoom, leading to some pixelated viewing depending on device & zoomlevel. This implementation will re-render for each zoom, including doing all the math for trackpad pinch zooms.
  • this implementation also only renders the visible pages (in-case hayro performance is worse than pdfium).

Excitingly this library also paves the way for us to convert pdfs to svgs so we're just a single hacker house with @ad-tra away from having some experience where you can draw on top of PDFs. It'll likely also be possible to implement pdf search (#3365) using this crate, as I believe the crate exposes text parsing functionality (but I'll have to double check to be sure).

The hayro people caution that they haven't done any perf work yet, but a coarse comparison of rendering all the pages resulted in a faster time to first frame than pdfium (although pdfium has to sit through a dl-load syscall which is probably slow, but also for our purposes is part of the comparison).

carfax pdf hayro: 96ms
carfax pdf pdfium: 155ms

@Parth Parth marked this pull request as ready for review November 11, 2025 18:04
@Parth Parth merged commit c59a2d2 into master Nov 11, 2025
1 check passed
@Parth Parth deleted the hayro-poc branch November 11, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

desktop support for freebsd navigate pdfs via keyboard pdf from source

1 participant