node make generic
outputs to thebuild/generic
directory. This directory contains two subdirectories, "build" and "web".
"build" contains "pdf.js", which is the actual PDF engine.
"web" contains a viewer, similar to the one at http://mozilla.github.io/pdf.js/web/viewer.html.After copying both of those previous directories to your app, you should be able to load the PDF file using
chrome.extensi/web/viewer.html?file=path%2Fto%3Ffile.pdf
PDF.js does not require
localStorage
.It's used if available for persisting settings such as scroll position, but if unavailable, PDF.just continues to work without it.
There is one significant issue though: PDF.js loads the localization files using synchronous XMLHttpRequest. This is not allowed in a Chrome app. You could solve this issue by serializing all files in the locales
, put it in a single JavaScript file, load this in viewer.html, and simplify l10n.js
to read the translations from the file I just described.