From 1bc5648a7b67c82405f86ed4bd0506f9ae3eb739 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Fri, 16 Oct 2026 01:00:24 +0200 Subject: [PATCH] fix: page scrolls up and the header goes off screen when previewing a scanned PDF (#32487) Opening a PDF without any text, such as a scan, in the knowledge base file viewer scrolled the whole page up. The workspace tabs, the knowledge base header and the viewer toolbar went off screen and a blank block appeared at the bottom. Scanned PDFs now open with the page in place, the same as PDFs with text. Fixes #32481 --- src/lib/components/common/PDFViewer.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/components/common/PDFViewer.svelte b/src/lib/components/common/PDFViewer.svelte index 3c20a46bdf..4aa41274eb 100644 --- a/src/lib/components/common/PDFViewer.svelte +++ b/src/lib/components/common/PDFViewer.svelte @@ -687,4 +687,9 @@ :global(.textLayer.selecting .endOfContent) { top: 0; } + + /* pdfjs leaves its text-measuring canvas in at 300x150 for PDFs without text */ + :global(.hiddenCanvasElement) { + display: none; + }