hypothesis / pdf.js-hypothes.is Goto Github PK
View Code? Open in Web Editor NEWPDF.js + Hypothesis viewer / annotator
PDF.js + Hypothesis viewer / annotator
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
Loving this project!
It would be great if we could use pdf.js's annotation features to map hypothesis annotations to PDF annotations.
Outline of the feature which would be a part of the "print" button, or an extra "export" button:
Follow the README setup for this repo
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.
I have tried contacting support via website and will soon try twitter. I cant save any annotations i made and dont see the 'save' button anywhere. Contact me @SeanQuinn781 or [email protected]
When hypothesis/h#1775 is merged (and deployed), we will be able to update the packaged PDF.js version to v1.0.907, which has some nice improvements.
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?
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.
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?
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.)
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. :)
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":
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
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.
two-iframes-bug
branch of my repomake deploy
localhost
(or localhost:80
)How do you annotate PDFs saved in gDrive. For example: https://drive.google.com/file/d/0BzYA1Z_-XipwNkpzOGl4alNPTEU/view?usp=sharing
When I click on the extension in Chrome nothing happens. gDrive is probably going to a primary way PDFs are shared in educatinional settings.
I noticed that the file does not have a pdf extension. Maybe we need to work on some documentation on how to share and then annotate files using gDrive.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.