Fernquill Engineering blog

How the first page of a large PDF
got three times faster

Engineering · 14 October 2026 · 6 minute read

Open a 400-page manual in a browser and you want to read page one, not wait for page four hundred. Until this summer, the Fernquill portal made you wait longer than it had to.

Where the time went

Opening a document did three things before the first page appeared: it read the whole cross-reference table, it measured every page, and it built the text index for search. On a large file the second step alone took more than a second.

None of that is needed to draw one page. The viewer needs the size of the pages it shows, and the size of the rest only roughly, to lay out the scroll bar.

Measure what you show

The engine now reads page sizes on demand. The first screen asks for a handful of pages; the rest are measured in the background, a few hundred at a time, while the reader is already looking at the document.

Until a page is measured, the layout uses the size of its neighbours. Most documents use one page size throughout, so the guess is almost always right, and when it isn't, the view stays on the page the reader is looking at while the pages above it settle.

The cross-reference table is still read in full, because a damaged file can only be repaired from all of it. But it's read once, and both the measuring and the drawing share it.

Fernquill Engineering blog

Search can wait

The text index moved off the opening path as well. It's built the first time someone searches, page by page, and the results come in as each page is done. Most people who open a document never search it, and they no longer pay for the index.

The numbers

The time until the first page shows, on a mid-range laptop, before and after the change:

DocumentPagesBeforeAfter
Product manual4121,840 ms590 ms
Annual report168920 ms330 ms
Contract24210 ms160 ms

Small documents gain little, because there was little to skip. The larger the file, the more the change matters.

What's next

The same idea comes to thumbnails: a sidebar with a thousand pages should only draw the ones on screen, and measure the rest as it scrolls.