From 5299512dfdbd409e208a2dcf035b11ce583eebe9 Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Fri, 22 Nov 2024 18:14:18 +0000 Subject: [PATCH] Resolve outline item destination to position --- src/core/module/outline-reader.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/module/outline-reader.js b/src/core/module/outline-reader.js index ceb81c819db9e..eb1a467ef7dc6 100644 --- a/src/core/module/outline-reader.js +++ b/src/core/module/outline-reader.js @@ -44,9 +44,10 @@ export async function getExistingOutline(pdfDocument, structuredCharsProvider) { // Disable sortIndex calculation because 2 we aren't using it yet, // and it causes significant slowdown for document with many papers // newItem.sortIndex = await getSortIndexFromTitle(pdfDocument, structuredCharsProvider, item.title, item.dest); - newItem.location = { - dest: item.dest, - }; + let position = await getPositionFromDestination(pdfDocument, item.dest); + if (position) { + newItem.location = { position }; + } } else if (item.unsafeUrl) { newItem.url = item.unsafeUrl; }