- hummus - c++ pdf manipulator
- mimeograph - api on a conglomeration of tools (poppler, tesseract, imagemagick etc)
- pdftotextjs - wrapper around pdftotext
- pdf-text-extract - another wrapper around pdftotext
- pdf-extract - wrapper around pdftotext, pdftk, tesseract, ghostscript
- pdfutils - poppler wrapper
- scissors - pdftk, ghostscript wrapper w/ high level api
- textract - pdftotext wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* Small Walker - v0.1.1 - 5/5/2011 | |
* http://benalman.com/ | |
* | |
* Copyright (c) 2011 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
// Walk the DOM, depth-first (HTML order). Inside the callback, `this` is the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function highlight(range) { | |
var textNodes = allTextNodes(range) | |
// Wrap all child text nodes | |
textNodes.forEach(function(node) { | |
var range = document.createRange() | |
range.selectNodeContents(node) | |
range.surroundContents(wrapperNode()) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This docker-compose.yml will run the Hypothes.is annotation server. | |
# (adapted from instructions here https://h.readthedocs.org/en/latest/INSTALL.html) | |
# | |
# Place this file in the working directory (clone of https://github.com/hypothesis/h) | |
# run with docker-compose up -d | |
# | |
# Now browse to Hypothes.is at http://192.168.59.103:8000/ and create an account | |
# You'll see the invitation email in Mailcatcher at http://192.168.59.103:1080/ | |
# Click that invitation link and log in on your local Hypothes.is | |
# And you are ready to annotate! |
Code here takes a DOM Selection Range instance and creates a highlighting for it by using getClientRects
. Approach was inspired by marks although here function attempts to find nearest positioned parent element to the commonAncestorContainer
and draw all the highilighting rectangles there, this avoids issues with an overflowing content.
- Approach ignores
z-index
which isn't great as some element might be overlaying the selection in which case it should not appear, but it does if we use highz-index
value. If we use lowz-index
value then some elements (possibly ones containing selection) might end up overlaying selection itself. - Rendered selections are scattered all o
Code here takes a DOM Selection Range instance and starts traversing a DOM starting from startContainer
up to endContainer
and wraps Text
elements with elements that have semi-transparent background & swaps img
elements with clones that are styled to have semi-transparent yellow overlay.
- Only handles selecting text and images & would not cover divs with backgrounds for instance.