An open API service indexing awesome lists of open source software.

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.

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 `