javascript - How to use PDF.js to load file included in web app (not from "file:" URL? -


i want able show pdf files within chrome app using pdf.js documentation non-existent. i've been unable find simple examples or tutorials show code load pdf relative url, show page, , navigate through pdf. have complex examples 95% of code other things , it's difficult parse these , find relevant functions. to:

  1. include relevant code in app (is "pdf.js" created "node make generic" , nothing else? or need include other js files well?)

  2. be able show pdf files inside myapp.crx file

  3. does pdf.js require "localstorage"? localstorage continue allowed in chrome extensions/apps or deprecated?

can tell me if #2 possible , how find example code or documentation on proper classes/functions call , files include/build?

  1. node make generic outputs build/generic directory. directory contains 2 subdirectories, "build" , "web".
    "build" contains "pdf.js", actual pdf engine.
    "web" contains viewer, similar 1 @ http://mozilla.github.io/pdf.js/web/viewer.html.

  2. after copying both of previous directories app, should able load pdf file using chrome.extensi/web/viewer.html?file=path%2fto%3ffile.pdf

  3. pdf.js not require localstorage.it's used if available persisting settings such scroll position, if unavailable, pdf.just continues work without it.

there 1 significant issue though: pdf.js loads localization files using synchronous xmlhttprequest. not allowed in chrome app. solve issue serializing files in locales, put in single javascript file, load in viewer.html, , simplify l10n.js read translations file described.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -