Page:
Viewer options
Pages
Additional Learning Resources
Benchmarking your changes
Bisecting a Regression
Bots
Contributing
Debugging PDF.js
Enumeration Assignments for the Telemetry Histograms
Frequently Asked Questions
Gallery of user projects and modifications
Home
PDF Viewer (Chrome extension)
Release Process
Setting up pdf.js Development Environment for Windows
Setup PDF.js in a website
Squashing Commits
Style Guide
Subscribe to Mozilla's Bugzilla Firefox PDF Viewer component
Third party viewer usage
Updating pdf.js on Mozilla Central
Viewer options
Windows Bot Setup
Clone
3
Viewer options
Tim van der Meij edited this page 2019-03-07 23:49:44 +01:00
Table of Contents
Below are the options for the PDF.js viewer that can be given at URL level. Multiple values of either type can be combined by separating with an ampersand (&) after the hash (for example: #page=2&zoom=200).
Options after the #
Example: https://mozilla.github.io/pdf.js/web/viewer.html#page=2
- page: page number. Example: page=2
- zoom: zoom level. Example: zoom=200 (accepted formats:
[zoom],[left offset],[top offset],page-width,page-height,page-fit,auto) - nameddest: go to a named destination
- pagemode: sidebar state. Example:
pagemode=none(accepted values:none,thumbs,bookmarks,attachments)
Options after the ?
Example: https://mozilla.github.io/pdf.js/web/viewer.html?file=compressed.tracemonkey-pldi-09.pdf
- file: the path of the PDF file to use (must be on the same server due to JavaScript limitations). Please notice that the path/URL must be encoded using
encodeURIComponent, e.g./viewer.html?file=%2Fpdf.js%2Fweb%2Fcompressed.tracemonkey-pldi-09.pdf