koreader / koreader

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
http://koreader.rocks/
GNU Affero General Public License v3.0
16.56k stars 1.26k forks source link

FR: Add stylus drawing annotation support to PDF files #8537

Open joaoponceleao opened 2 years ago

joaoponceleao commented 2 years ago

With the Elipsa and now the Sage both allowing the use of a stylus for hand-written notes or drawings, and with Kobo's pdf implementation still lacking (in cropping, panning, and contrast adjustments), it would be great if Koreader could implement pen annotations on the pdf.

This has already been mentioned in issue #2633 but in that issue it assumes adding stylus support for all documents. That is quite a difficult endeavour, and one that is already covered in Kobo's default reader for epubs. It's Kobo's default reader difficulty in handling pdfs, and its use of the highlighter (which is just a drawing type annotation with a bigger width) that makes the default reader less adequate for pdf annotations particularly.

I would propose adding drawing annotations support to pdfs only. This could be much simpler than trying to figure out how to implement drawing annotations in epubs. Hand-drawn annotations have been supported in pdfs for a long time and there is no need to worry about different sizes of the device, reflow, etc. The highlighting annotation can stay the way it is already implemented in the current Koreader (where the stylus is used as a fancy pointer) - that would be the preferred way to highlight text anyway. The only change here would be a requirement to use the stylus button while highlighting. Drawing on the pdf with the stylus directly could produce a drawing-type annotation.

Exports of annotations can either be implemented in Kobo or left to the user. See the following repo for an existing script that currently parses Kobo's default reader's highlights and exports them as images in an html: https://github.com/willmooney3/highlight-extractor or my own fork of it which exports them as text. In Kobo's default reader, the highlighter and drawing functions produce exactly the same type of annotation, the only difference being the stroke width. These scripts help complete the annotation process of a pdf, but the problem remains, which is that Kobo's rendering of pdfs is lacking: some pdfs lack too much contrast to be readable, cropping is badly implemented, zoom positions get reset at every page turn, etc...

I realise that this is a big feature request, but thought I would put it down anyway. Keep up the great work with Koreader.

Atrate commented 2 years ago

I'd give this a big +1, KOReader beats every other PDF reader out there (from what I've tried) and the only thing keeping me with a proprietary one is the fact that annotations aren't supported in KOReader.

Estebiu commented 1 year ago

I'd really appreciate this.

bloodripelives commented 5 months ago

Adding my support to this-- in particular, being able to annotate PDFs in KOReader would turn my kobo elipsa into a device suitable for reading sheet music, which it currently isn't purely because of the limitations on PDF display and file organization in the stock firmware.