Giter Site home page Giter Site logo

ai-se / pdf.js-hypothes.is Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hypothesis/pdf.js-hypothes.is

1.0 8.0 0.0 4.87 MB

PDF.js + Hypothesis viewer / annotator

HTML 1.25% Java 69.54% JavaScript 26.90% CSS 1.83% Python 0.47% Shell 0.01%

pdf.js-hypothes.is's Introduction

PDF.js + Hypothes.is on your site

Thanks to the kind folks in the Mozilla PDF.js project we've put together a simple PDF viewer that includes annotation.

This is an "out of the box" PDF.js Viewer with these changes:

  • added the <script src="https://hypothes.is/embed.js" ...></script> code
  • customized the viewer.js code to generate a rel="canonical"--as the viewer URL will differ from your PDF's URL, but they should both show the same annotations.

The project is entirely static HTML, JS, and CSS. Enjoy!

Try it out!

Clone this repo, then...

cd pdf.js+hypothes.is
python -m SimpleHTTPServer
# if you're on a Mac, do...
open http://localhost:8000/web/viewer.html
# if you're not, open your browser to that URL

The sample PDF should render and the Hypothes.is comment bubble icon should be visible in the top right corner.

Viewing Your Own PDF's

The viewer.html file supports a file query parameter, so requesting a different PDF hosted under this same domain, looks like this:

http://localhost:8000/web/viewer.html?file=%2Fyourpdf.pdf

%2F is the URL escaped form of /--so this assumes you have a yourpdf.pdf file hosted at http://localhost:8000/

License

PDF.js and the viewer bits (in build and web) are licensed under the Apache License 2.0.

Hypothes.is embed.js is currently loaded from the live web service, so there's no additional licensing needed (checkout the hypothesis/h project if you'd like to host your own (h is BSD licensed).

pdf.js-hypothes.is's People

Contributors

bigfatnoob avatar bigbluehat avatar

Stargazers

Matt Menzenski avatar

Watchers

Tim Menzies avatar James Cloos avatar Liang Dong avatar  avatar Wei Fu avatar Kayleigh Migdol avatar Ken Tu avatar Eric Huynh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.