Skip to content

Commit

Permalink
Use a per version query string for fetching the pdf.js worker.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joni Orponen committed Feb 11, 2019
1 parent ab86376 commit fcfda4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ PDFJS.cMapUrl = '../web/cmaps/';
with
``` javascript
PDFJS.imageResourcesPath = '/pdfjs/web/images/';
PDFJS.workerSrc = '/pdfjs/web/pdf.worker.js';
PDFJS.workerSrc = '/pdfjs/web/pdf.worker.js?version=<version_number>';
PDFJS.cMapUrl = '/pdfjs/web/cmaps/';
```

The version is added as a query string above so we ensure users will get the matching version of the worker despite caching.

## `app/assets/stylesheets/pdfjs_viewer/pdfjs/viewer.css`

Replace all `url(images/` with `url(/pdfjs/web/images/`
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/pdfjs_viewer/viewer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fcfda4f

Please sign in to comment.