https://github.com/200ok-ch/pdf-viewer
A Web Component utilizing React providing a convenient <pdf-viewer> tag based on PDFjs. Written in ClojureScript.
https://github.com/200ok-ch/pdf-viewer
Last synced: 5 months ago
JSON representation
A Web Component utilizing React providing a convenient <pdf-viewer> tag based on PDFjs. Written in ClojureScript.
- Host: GitHub
- URL: https://github.com/200ok-ch/pdf-viewer
- Owner: 200ok-ch
- Created: 2015-06-10T16:05:15.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-20T08:36:30.000Z (about 10 years ago)
- Last Synced: 2024-05-01T11:37:34.316Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 1.87 MB
- Stars: 6
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ``
This project gives you a new HTML tag `` that can be configured
with the attributes `src` and `width`. Easy as that.More specifically, this is a Web Component based on [HTML5 Custom
Element](https://w3c.github.io/webcomponents/spec/custom/) containing a
[React](http://facebook.github.io/react/) component providing a PDF
viewer based on [PDFjs](https://github.com/mozilla/pdf.js). Since Custom
Elements are not yet [supported in all
browsers](http://caniuse.com/#feat=custom-elements), this project uses
[Webreflections
document-register-element](https://github.com/WebReflection/document-register-element)
library.If that weren't enough trendy buzzwords, the whole thing is written in
[ClojureScript](http://github.com/clojure/clojurescript) employing
[Figwheel](https://github.com/bhauman/lein-figwheel) for an awesome development
experience. Also it's not actually written in React, but in
[OM](https://github.com/omcljs/om), a ClojureScript interface to React.## Usage
There is a working demo in the folder `dist`. You can go there and serve the
folder locally(for example with `python -m SimpleHTTPServer`) for testing
purposes. Also you can use the assets in there and copy them to the project
where you might want to employ `pdf-viewer`.To enable the `` tag in your project, you need to include the
[pdf-viewer.js](dist/pdf-viewer.js) JavaScript file, preferably just before
your `