Pdf.js: Want to hide Sidebar

Created on 27 Nov 2018  路  3Comments  路  Source: mozilla/pdf.js

Configuration:

Web browser and its version: Google Chrome : Version 63.0.3239.132 (Official Build) (64-bit)
Operating system and its version: Windows 10 x64
PDF.js version: 2.0.943
Is a browser extension: No

image

I want to hide sidebar. Please give me your suggestions.

Most helpful comment

What about just by default making it hidden vs expanded? That seems like it should be some kind of a parameter or very easy change. Unfortunately the viewer.js is like 13,000 lines of code. I can't find where to keep it collapsed.

All 3 comments

You can make a custom build where you remove the sidebar HTML elements and the JavaScript code that initializes the sidebar, which is https://github.com/mozilla/pdf.js/blob/master/web/app.js#L383-L403 amongst other usages in that file.

What about just by default making it hidden vs expanded? That seems like it should be some kind of a parameter or very easy change. Unfortunately the viewer.js is like 13,000 lines of code. I can't find where to keep it collapsed.

Theoretically, it can be reached by a corresponding option in the URL hash: https://github.com/mozilla/pdf.js/wiki/Viewer-options It also works with the example implementation: https://mozilla.github.io/pdf.js/web/viewer.html#page=2&pagemode=none (pagemode=none is the switch in question). However, it doesn't work for me in a slightly more involved setting (pdf.js embedded in an iframe whose src is set dynamically)...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kleins05 picture kleins05  路  3Comments

smit-modi picture smit-modi  路  3Comments

anggikolo11 picture anggikolo11  路  3Comments

zerr0s picture zerr0s  路  3Comments

PeterNerlich picture PeterNerlich  路  3Comments