Pdf.js: Document outline sidebar opens on load

Created on 28 Sep 2017  路  2Comments  路  Source: mozilla/pdf.js

Link to PDF file (or attach file here):
WorkingwithBookmarks.pdf

Configuration:

  • Web browser and its version: Firefox 55
  • Operating system and its version: Windows 8.1
  • PDF.js version: 1.9.426
  • Is an extension: No

What is the expected behavior? (add screenshot)
The sidebar is not open on load

What went wrong? (add screenshot)
pdfjssidebar

Most helpful comment

For users who do not want the sidebar to open automatically and are baffled by the above reference to the console:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

(2) In the search box above the list, type or paste pdfjs and pause while the list is filtered

(3) Double-click the pdfjs.disablePageMode preference to switch the value from false to true

Now instead of the relevant panel opening automatically, if the PDF specifies that it should be displayed a green dot will appear on the sidebar button to alert you.

All 2 comments

You get the exact same behaviour in Adobe Reader as well, since the PDF file itself specifies that this should happen when the document is opened (through the /PageMode /UseOutlines entry in the Root of the document).

In the PDF.js default viewer however, this behaviour can be turned off by setting the disablePageMode preference to true if you do not wish to use this functionality.[1]

Closing as answered, since this is working as intended.


[1] Setting the preference is done by executing PDFViewerApplication.preferences.set('disablePageMode', true); in the console, and then reloading the viewer.

For users who do not want the sidebar to open automatically and are baffled by the above reference to the console:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

(2) In the search box above the list, type or paste pdfjs and pause while the list is filtered

(3) Double-click the pdfjs.disablePageMode preference to switch the value from false to true

Now instead of the relevant panel opening automatically, if the PDF specifies that it should be displayed a green dot will appear on the sidebar button to alert you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SehyunPark picture SehyunPark  路  3Comments

sujit-baniya picture sujit-baniya  路  3Comments

dmisdm picture dmisdm  路  3Comments

liuzhen2008 picture liuzhen2008  路  4Comments

PeterNerlich picture PeterNerlich  路  3Comments