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; }