17

I want to configure my pdf.js in Firefox.

Specifically, I want to set the default zoom from auto to something else, say 150%.

I found a pdfjs.database in about:config, which has a "zoom":"auto" in that table. I changed auto to 150% but nothing happened when I opened a pdf.

It didn't crash and still opened pdf in auto zooming. Is it possible to configure pdf.js for this?

Mokubai
  • 95,412
Fxyang
  • 183

2 Answers2

29

Mozilla have now implemented a default zoom setting, although it's only available through about:config.

You can change the pdfjs.defaultZoomValue in about:config to change the default zoom.

Set it to a number for a number (no percent sign) for a given default percent zoom.

Other possible values are page-width, page-height, page-fit and auto.

https://github.com/mozilla/pdf.js/pull/3850

MJ Walsh
  • 403
2

It appears that the pdfjs.database you found is actually a list of previously opened pdfs and their saved pdf view settings including last read page number and zoom level as well as a couple of other view settings.

On my machine this is a patial display of some of the contents of that key.

{"files":   [{"fingerprint":"7a798210f6814668a779da60662f2c6d","exists":true,"page":4,"zoom":"auto","scrollLeft":0,"scrollTop":617},  
{"fingerprint":"604c4e776174cb1f9b3f835f566827","exists":true,"page":2,"zoom":"150","scrollLeft":612,"scrollTop":792},  
{"fingerprint":"fb6578d44ae9f8f346bd67d57a2d8","exists":true,"page":1,"zoom":"auto","scrollLeft":0,"scrollTop":792}]}

Opening a new pdf and changing the view setting simply added a new item to the end of the list.

While changing the Zoom to 150 on all those items will affect documents you have already opened I do not believe you can set this up for new pdfs.

It appears this feature is known but not being actively worked on. Also see this drupal page.

Source Google Search

Mokubai
  • 95,412