Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arantes555/pdfjs-viewer
A library to allow integrating a PDFJS viewer in other pages easily
https://github.com/arantes555/pdfjs-viewer
Last synced: about 1 month ago
JSON representation
A library to allow integrating a PDFJS viewer in other pages easily
- Host: GitHub
- URL: https://github.com/arantes555/pdfjs-viewer
- Owner: arantes555
- Created: 2018-03-01T23:02:17.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-02T13:20:53.000Z (almost 7 years ago)
- Last Synced: 2024-11-24T07:03:00.380Z (about 1 month ago)
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PDFJS-Viewer
A library to allow integrating a PDFJS viewer in other pages easily# Usage
You have to import both PDFJS, and PDFJS-Viewer into your HTML page.
For your convienience, this package has a version of PDFJS under `/build`.
Also, your HTML page needs to have the DOM for the viewer. You can copy/paste the content of `` in `/web/viewer.html`.
Then, you can call `window.PDFViewer(options)`.
`options` is an optional Object argument, which defaults to the following:
```javascript
{
defaultUrl: DEFAULT_URL, // The document to load upon instantiation
isViewerEmbedded: false,
focusPreviewer: true, // Auto-focus the previewer to allow keyboard shortcuts directly after instantiation
allowPrinting: true, // Show a "Print" button
allowDownload: true, // Show a "Download" button which downloads the current document
allowBookmark: true, // Show a "Bookmark" button which gives an URL that reproduces the exact current view. If disabled, hides the button and ignores the URL hash parameters.
allowUrlQuery: true, // Allow changing the file with URL like `viewer.html?file=foo.pdf`
allowOpenFile: true // Allow previewer to open new files.
}
```