Comments (5)
Are you thinking of something like hi-lock for PDF buffer ?
Reading, displaying and writing annotations would be possible, i.e. is
supported by the underlying library, and is something I have already
considered.
-ap
from pdf-tools.
Yes, exactly. I thought that poppler should support this. It would be great to be able to stay in emacs when reading and annotating pdf files.
Ideally, I was thinking about something like highlighting/underlining/marking words in the pdf file and have those highlighted areas linked to another buffer, e.g. to a point in an org-mode buffer where I can comment my highlight and add/attach more information to it.
One could define the behaviour like this: if user starts to highlight stuff in the pdf, automatically create an orgmode-file that has the same name as the pdf (e.g. "test.pdf.org") or let the user define a default org file for annotating pdfs ("~/my_pdf_notes.org"). For every highlight, use org-capture to create a new entry in the orgmode-file with the line number and the first hightlghted words. Let org-capture add date+time information and prompt for user input.
All this can be done without leaving the pdf buffer (org-capture is a pop-up) and at the end, we would have an org file full of annotations on the pdf file in plain text but also easily exportable to LaTeX, presentation slides, blog format etc. Some of the annotations would be marked tasks that appear in an agenda ("find that reference") and others could be tagged and be linked to other tags.
One could then link this information to other bibliographic data for referencing etc.. See here: http://www-public.it-sudparis.eu/~berger_o/weblog/2012/03/23/how-to-manage-and-export-bibliographic-notesrefs-in-org-mode/
from pdf-tools.
The way I see this fitting in the current picture is by extending the types of links of a PDF document. Let's say, there is a new type `user-annotation' or something. Now, normal links (like from an internal \ref) are provided by poppler, but it speaks nothing against adding to these, before handling the display, mouse behaviour etc.
This type would have a designated handler function as an argument, which would be called, when the corresponding link is activated by the user.
Creating and deleting them interactively, e.g. by dragging the mouse, isn't very hard either.
-ap
from pdf-tools.
Great! Sounds perfect! Unfortunately, I am not a programmer but I will certainly test if it is going to work. And I can imagine that the org-mode community would love this, too. If you are going to include this into your project, maybe you would like to make a small announcement here: http://news.gmane.org/gmane.emacs.orgmode
from pdf-tools.
I think this is all possible now,
i.e. pdf-annot-activate-handler-functions
allows for arbritrary
stuff to happen, when some annotation was clicked upon and custom
annotations may be identified by creating them with some unique label
property. Here is a toy example:
(require 'pdf-annot)
(add-hook 'pdf-annot-activate-handler-functions 'pdf-org-annotation-handler)
(add-hook 'pdf-annot-print-annotation-functions 'pdf-org-print-annotation)
(setq pdf-annot-activate-created-annotations t)
(defun pdf-org-add-annotation (pos)
(interactive
(list (pdf-util-read-image-position "Click ...")))
(pdf-annot-add-text-annotation
pos
"Circle"
`((color . "yellow")
(label . "org:annot"))))
(defun pdf-org-annotation-handler (a)
(when (equal (pdf-annot-get a 'label)
"org:annot")
(pop-to-buffer (get-buffer-create "annotations.org"))
;; Do SOMETHING.
t))
(defun pdf-org-print-annotation (a)
(when (equal (pdf-annot-get a 'label)
"org:annot")
"Org annotation, click to do SOMETHING"))
I guess I'll be closing this then.
from pdf-tools.
Related Issues (20)
- How can one make a selection persist HOT 2
- Open annotation text box automatically HOT 1
- (invalid-function pdf-view-current-page) HOT 1
- AUCTeX and pdf-tools: split windows configuration HOT 5
- Use Nix instead of Homebrew when nix-env is available
- Gentoo dev-util/pkgconfig no longer in repos HOT 1
- Feature request: reorder/remove pages HOT 4
- Wayland HOT 2
- Zero or negative size array HOT 1
- Error while building the epdfinfo program HOT 2
- I get this ```pdf-info-query: epdfinfo: Unable to create synctex scanner, did you run latex with `--synctex=1'``` when I double-click on a word to select it. Is it related to this? Should I switch branches on `pdf-tools` to the PR https://github.com/politza/pdf-tools/pull/527? HOT 1
- Image command Fit to window height (s h) doesn't work in PDFView mode
- Customize buttons are displayed with unraised face when emacs client launched via daemon/server
- Printing with filename that contains a space HOT 3
- italics not displayed HOT 15
- pdf-tools-20220426.2203's epdfinfo doesn't build anymore on Arch Linux (requires c++17, not c++11) HOT 6
- Adding images to pdfs HOT 2
- Cannot install on Manjaro poppler-private header HOT 3
- error when installing pdf-tools HOT 3
- FR: Double clicking on a word to highlight it HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf-tools.