Pdf.js: PDF Open Parameters should be implemented

Created on 20 Feb 2013  路  11Comments  路  Source: mozilla/pdf.js

PDF documents can request certain viewer configuration options on open, including:

  • zoom level
  • page configuration (ie continuous/booklet/single page)
  • hide menu bar
  • hide tool bars
  • hide scroll bars
  • Request full screen
  • display bookmarks/thumbnails/layers/none

These settings can be embedded as properties within a document, or requested as URL parameters - see http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf

Many of these capabilities already exist in pdf.js so implementation should not be difficult?

1-viewer 2-feature

Most helpful comment

I would kill to be able to hide the toolbar and fit the document horizontally (view=FitH)

All 11 comments

  • Zoom is already partially implemented, for example as #page=5&zoom=150,0,100.
  • What you refer to as "page configuration" doesn't appear to be part of the specification, at least I can't find it. Furthermore, these options aren't yet implemented in pdf.js. But work is under way, see #2660 and #2709.
  • Regarding disabling toolbars/scrollbars, I don't know what the official position is. But hiding the scrollbars would most likely break scrolling.
  • As for displaying bookmarks/thumbnails, there is a PR that implements the pagemode parameter, see #2676.
  • Also, there is PR that adds a partial implementation of search, see #2485.

I hope that the above sheds some light on the current state of URL parameters in pdf.js.

Thanks. But main thing is these parameters can be embedded in a document as well as via URLS and it would be good to respect that - particularly, for starters, the bookmarks/thumbs display setting.

Thanks. But main thing is these parameters can be embedded in a document as well as via URLS and it would be good to respect that - particularly, for starters, the bookmarks/thumbs display setting.

@BMSKiwi not sure what do you mean? http://mozilla.github.com/pdf.js/web/viewer.html#page=1&zoom=215,0,792 and http://mozilla.github.com/pdf.js/web/compressed.tracemonkey-pldi-09.pdf#page=5&zoom=215,0,792 work. So does http://download.intel.com/technology/computing/vptech/Intel(r)_VT_for_Direct_IO.pdf#G4.10628 . Please provide more information.

I see. So you just want to hide UI controls and set modes?

Look at these two modified versions of the test PDF

http://www.euroclass.co.nz/resources/compressed.tracemonkey-pldi-09-facing-bookmarks.pdf
http://www.euroclass.co.nz/resources/compressed.tracemonkey-pldi-09-singlepage-thumbs.pdf

Then look at them in Reader. I'm suggesting pdf.js follow that behaviour.

I would kill to be able to hide the toolbar and fit the document horizontally (view=FitH)

Quite an underrated feature...it would be nice to know if maintainers would approve a pull requests which makes PDF.js comply with the default pdf viewer parameters. Else I won't waste my time trying.

it would be nice to know if maintainers would approve a pull requests which makes PDF.js comply with the default pdf viewer parameters. Else I won't waste my time trying.

In general it's unfortunately not really possible for anyone to guarantee beforehand that a particular PR will be accepted (most PRs also require changes in response to review comments); especially not having seen a patch, nor knowing what it will contain and how the solution is expected to look.

@Snuffleupagus surely we cannot expect an acceptance-guarantee. 馃槃 Knowing that a pull request(if done properly and revised if necessary) will not be refused for being "out of scope" is enough to start developing. If necessary, the parameters could still be split into groups of acceptable, and non-acceptable ones.

@Snuffleupagus surely we cannot expect an acceptance-guarantee. 馃槃 Knowing that a pull request(if done properly and revised if necessary) will not be refused for being "out of scope" is enough to start developing. If necessary, the parameters could still be split into groups of acceptable, and non-acceptable ones.

From this reply I take that such a PR is not out of scope and was just not fully addressed yet. Will reference my toolbar PR here later which should resolve a part of this issue.

From this reply I take that such a PR is not out of scope and was just not fully addressed yet.

There's a lot of relevant discussion in PR #3815 as well, and that one was also ultimately closed; whether or not something like this will be accepted probably depends quite a bit on the complexity of the solution as well given that it's somewhat of an edge-case (and keeping in mind that code needs to be maintained too).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

liuzhen2008 picture liuzhen2008  路  4Comments

aaronshaf picture aaronshaf  路  3Comments

patelsumit5192 picture patelsumit5192  路  3Comments

THausherr picture THausherr  路  3Comments

jigskpatel picture jigskpatel  路  3Comments