Giter Site home page Giter Site logo

pdf.js-hypothes.is's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pdf.js-hypothes.is's Issues

Not working in iframe anymore ?

I have updated my code since the merging of pull request #21 and now, when viewing in an iframe, I can't get the hypothes.is layer over the pdf.js any more (it is fine when opening the viewer in the main window)

It looks like pdfjs-init.js is properly injected but does not fire the injection of embed.js

Any clue ?

Thanks

feature request: merge annotations into pdf popup annotations

Loving this project!

It would be great if we could use pdf.js's annotation features to map hypothesis annotations to PDF annotations.

  • This would be good (for example) just before a print, such that the PDF printer driver can make something nice out of the annotations.
  • Another usecase is to share annotated PDFs via interfaces that expect annotated PDFs (journals and other types of editing environments).

Outline of the feature which would be a part of the "print" button, or an extra "export" button:

  • maps normal annotations to pdf popup annotations
    • optionally include group name and/or author name (good for anonymous reviews)
    • requires a pop-up with options or pre-configured setting somewhere else
  • maps page annotations to marging notes? free text. don't know what the best thing to do is
    • same optional mentioning of group/author name
  • maps highlights to highlights
  • If author names are not to be included in the annotations, then this feature should guarantee the privacy
    of the authors of the annotations. no meta-data should be included in the PDF that could reveal their identity.

view switcher missing for logged-in user

Steps to reproduce:

  1. Follow the README setup for this repo

  2. Load http://localhost:8000

Bad behavior

When logged in, the view switcher vanishes and the console says:

console.js:26 Error connecting to H push notification service
...
Received a broken close frame containing a reserved status code.

image

Ensuring everyone annotates same PDF

What strategies have folks developed to ensure readers are annotating the same PDF? For example if I am using a locally hosted file but someone else finds the article at a library how do we see each other's annotations?

Right now I am thinking I just link directly to a file and say, "use this one" but I am wondering long term can things such as DOI be used to identify PDFs regardless of where they are hosted?

Upgrade PDF.js to the latest v2.x release

This repository currently has a version of PDF.js that is several years old. We are updating our other PDF annotation environments to the latest v2.x release (see tracking issue) and we should update this repository as well.

On a related note, it might be worth considering turning this repo into an npm package so it is easier for consumers to update. We could potentially also statically host the HTML as a convenience.

pdf.js v1.9.426 support

I am searching for a solution to annotate pdf files with pdf.js. Hypothes.is looks like a good solution, but this project does not support any newer pdf.js versions.

Should i move further to another project because this solution is abandoned, or is there any plan to reanimate this project?

Permit specifying additional options via URL

It appears that URL-based parameters are parsed from the viewer URL in order to configure the PDF reader, but only the file parameter is currently supported.

Setting other viewer options, like openSidebar, can't currently be specified there.

It would be nice if other viewer options could be provided as URL parameters to viewer.html! (When safe to provide that way, of course.)

RFC: pdf.js-hypothes.is as standalone "native" application via Electron

I tend to use hypothes.is as the default PDF annotation tool for my academic literature. Currently, this means having to pull up a PDF in Firefox and activating hypothes.is.

I was wondering what you thought about having pdf.js and hypothes.is running as a standalone application built using Electron. It could be packaged for Linux, OS X and Windows, and would allow users to use a lighter app for viewing PDFs. And when you eventually have offline support for hypothes.is, this will allow me to work with PDFs while travelling without internet!

I would be happy to work on this in my (not-abundant) spare time, but (a) I am not a developer so the learning curve will be steep and (b) this might be something you've already considered and are working on or have dismissed as impractical. :)

Annotation in wrong place

I have the chrome extension 1.926.0.0. When viewing a PDF with an annotation, the annotation appears in the wrong place. When searching for the annotation text, the text highlight position is wrong. When searching for the same text in Chrome's default PDF rendered or using Preview (Mac), the highlight for the searched for text appears in the correct position.

Search for "job polarisation" in the following PDF and it will look like the screenshot below. You can see if you try to annotate the text the actual text annotated is "forworkers perform":

image

Hanging on pdf.worker.js

I got it working a few days ago, but today seems like a no go. Not sure why. It is hanging on pdf.worker.js, and eventually proving unresponsive. When I keyboard cancel out the .pdf viewer loads, and the sidebar, but no .pdf - a second keyboardinterrupt stops the webserver.

21:44 ~/Github/beagle/pdf.js-hypothes.is $ python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/viewer.html HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/viewer.css HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/compatibility.js HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/l10n.js HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/pdf.js HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/viewer.js HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/texture.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-viewThumbnail.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-viewOutline.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-search.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-pageUp.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-sidebarToggle.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-menuArrows.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-zoomIn.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-openFile.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-presentationMode.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-print.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-bookmark.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-pageDown.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-secondaryToolbarToggle.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-zoomOut.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/images/toolbarButton-download.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/locale/locale.properties HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:44:20] "GET /web/pdf.worker.js HTTP/1.1" 200 -
^C^C----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 53702)
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 651, in __init__
    self.finish()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 705, in finish
    self.wfile.flush()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
KeyboardInterrupt
----------------------------------------
127.0.0.1 - - [07/Sep/2014 21:48:30] "GET /web/locale/en-US/viewer.properties HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:30] "GET /web/images/secondaryToolbarButton-firstPage.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:30] "GET /web/images/secondaryToolbarButton-lastPage.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:30] "GET /web/images/secondaryToolbarButton-rotateCw.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:31] "GET /web/images/secondaryToolbarButton-rotateCcw.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/viewer.html HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/viewer.css HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/compatibility.js HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/l10n.js HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/pdf.js HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/viewer.js HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/texture.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-viewThumbnail.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-viewOutline.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-sidebarToggle.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-search.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-pageUp.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-menuArrows.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-openFile.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-pageDown.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-presentationMode.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-print.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-zoomIn.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-zoomOut.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-bookmark.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-secondaryToolbarToggle.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/images/toolbarButton-download.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/locale/locale.properties HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2014 21:48:48] "GET /web/pdf.worker.js HTTP/1.1" 200 -
^C----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 53844)
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 649, in __init__
    self.handle()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SimpleHTTPServer.py", line 46, in do_GET
    self.copyfile(f, self.wfile)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SimpleHTTPServer.py", line 177, in copyfile
    shutil.copyfileobj(source, outputfile)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 52, in copyfileobj
    fdst.write(buf)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 324, in write
    self.flush()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
KeyboardInterrupt
----------------------------------------
127.0.0.1 - - [07/Sep/2014 21:48:53] "GET /web/locale/en-US/viewer.properties HTTP/1.1" 200 -
^CTraceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SimpleHTTPServer.py", line 220, in <module>
    test()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SimpleHTTPServer.py", line 216, in test
    BaseHTTPServer.test(HandlerClass, ServerClass)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 599, in test
    httpd.serve_forever()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 236, in serve_forever
    poll_interval)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 155, in _eintr_retry
    return func(*args)
KeyboardInterrupt

Multiple Iframes - Sidebars Don't Work Properly

Issue

If you embed two PDFs using iframes on the same page a la

<html>
  <body>
    <iframe style="width:100%" height="600" src="/viewer/web/viewer.html?file=/demo.pdf"></iframe>
    <iframe style="width:100%" height="600" src="/viewer/web/viewer.html?file=/demo1.pdf"></iframe>
  </body>
</html>

the sidebars don't work correctly. In particular, the first sidebar won't include any annotations and the second sidebar will include the annotations of both PDFs.

Steps to Reproduce

  1. Clone the two-iframes-bug branch of my repo
  2. Run make deploy
  3. Navigate to localhost (or localhost:80)

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.