emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: FYI Djvu package extension with svg annotations


From: dalanicolai
Subject: Fwd: FYI Djvu package extension with svg annotations
Date: Sun, 23 May 2021 08:28:15 +0200


I have accidentally sent this mail to bug-gnu-emacs@gnu.org, but I actually wanted to post it here

---------- Forwarded message ---------
From: dalanicolai <dalanicolai@gmail.com>
Date: Sun, 23 May 2021 at 00:27
Subject: FYI Djvu package extension with svg annotations
To: <bug-gnu-emacs@gnu.org>


I have tried to inform you about this before by replying to an old bug-report, but it seems that that did not work out well.

I will paste the text of that message below (with some updates)

Hi Roland and others,

I have made a small modification to the djvu-image function so that it displays annotations. The code can be found here (a small comment follows)
Although I had extended djvu.el already with some nice extra features in djvu2, those extensions mainly relied on the usage of the external imagemagick command.
This time however, I have used Emacs capability of drawing svg files. I have simply embedded the ppm in an svg image and subsequently we can use svg.el to draw annotations.

To test it you can just load the file after you loaded the original djvu.el and then open some djvu with annotations.
I think the annotation part is quite clean code, and it is really just a small modification.

Additionally in the section Keyboard annotation functionality I have added a quite fancy function to make highlights with the keyboard.
You can test it after loading the file by using the command djvu-keyboard-annot.

It is up to you if you also like to implement that. If you like to implement any of this in djvu.el, then I could make a patch.
Or you can just copy the code and do with it whatever you like.

Additionally I have a small question (to anyone receiving this mail)
I wanted to keep the annotation draw functionality in a separate function outside of the djvu-image function, but then I had to pass all the local variabels,
Do you happen to know some (closure like?) trick to pass the local variables while defining the function outside of the djvu-image function (so without passing the variables explicitly as arguments)?

I forgot to mention that that keyboard annotation function is meant to be handy for annotating directly from djvu-image-mode...

Thanks again!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]