question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot use nameddest url param while bookmarks are accessible from viewer

See original GitHub issue

Attach (recommended) or Link to PDF file here:

test_bookmark.pdf

Configuration:

  • Web browser and its version: Chrome version 84.0.4147.105 (64 bits)
  • Operating system and its version: macOS Mojave 10.14.5
  • PDF.js version: 2.4.456
  • Is a browser extension: No

Steps to reproduce the problem:

  1. make an object with the viewer :
<object id="cg" data="http://localhost:9000/your-path/web/viewer.html?file=test_bookmark.pdf#pagemode=none&nameddest=bookmark1"></object>

What is the expected behavior?

We go to the bookmark

What went wrong? (add screenshot)

Cannot retrieve my bookmark with url nameddest, but accessible from viewer bookmarks panel

PDFLinkService.navigateTo: "null" is not a valid destination array, for dest="bookmark1"
Capture d’écran 2020-08-03 à 17 18 10

Try with pre-release 2.5.207 :

Capture d’écran 2020-08-03 à 17 11 32

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Snuffleupaguscommented, Jul 26, 2021

You may wish to reconsider closing since the sample provided by OP does have /Dest entries

As mentioned in https://github.com/mozilla/pdf.js/issues/12164#issuecomment-668104121 those do not exist if you actually look at the /Root dictionary of the document, which is what matters here! (The contents of the /Outlines dictionary, which I’m guessing is what you’re looking at, doesn’t really apply here.)

I am not saying it is a good example or validly constructed HOWEVER PDFium will respect the acrobat style URL even if its only at page level

It definitely doesn’t seem valid, from a PDF specification perspective, and given that most documents actually use destinations correctly I’m thus not convinced that we need to add “hacks” to support such a (broken) use-case.

0reactions
GitHubRulesOKcommented, Jul 26, 2021

@timvandermeij You may wish to reconsider closing since the sample provided by OP does have /Dest entries and of those Bookmark1 is acceptable by practically every other reader as a URL #nameddest=bookmark1 here I download above example I am not saying it is a good example or validly constructed HOWEVER PDFium will respect the acrobat style URL even if its only at page level

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parameter 'Nameddest' in PDF files - Stack Overflow
I'd like to have the same accessibility but in a pdf file. My docx file has headers than later on get converted to...
Read more >
Linking to within a PDF using named destinations
Linking to within a PDF using named destinations · 1. Click a link to a named destination in PDF file. · 2. Scroll...
Read more >
Introduction to PDF Destinations - Evermap
A destination is essentially a named page view. It associates a unique name with a specific page location within a single PDF document....
Read more >
Word to PDF - Hyperlink-to-Bookmark problems | Adobe Acrobat
You should use the PDF open parameters for a page number or a named destination (you can't link to a regular bookmark)
Read more >
Chapter 6: Creating actions, destinations, and bookmarks
When we discussed the Link building block in chapter 3, we created a URI action ... The PDF viewer is usually a closed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found