Repository navigation
Implement support for Highlight annotations - #5065
timvandermeij wants to merge 1 commit into
Conversation
|
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 |
|
i checked the spec you referenced. The current pdf.js code implements a subtype called "text" but I cannot find it in the spec. |
|
@CodingFabian It is defined here: I'm current working on a total rewrite of the annotation layer code, but I thought this patch was so easy that I would just post it so we have the support until/if the rewritten code lands (primarily because it fixes the mentioned open issue). I already have a small working version of the new code locally. It uses the abstraction used by PDFNet to get much more readable and extendable code. See http://www.pdftron.com/pdfnet/docs/PDFNetJava/pdftron/PDF/Annots/Text.html for example. I'm also aiming to add support for Underline etc. to the new code because the new code allows for these extensions much more easily by inheriting almost all properties from the parent class Text. Why I'm rewriting the code:
|
|
ok, just saying that from how i read the spec, "Underline, Squiggly, and StrikeOut" are not really different from Highlight. it defines how it "looks" in the annotated text. The actual annotation could be implemented the same way. |
|
Right. Aside for the lay-out difference, I see no problem doing that in this PR too. At least we have the annotations then; styling can be done later. |
|
I'm going to close this for now. I will implement this (with the other types mentioned here) in the new framework I'm currently creating for completeness sake. |
|
Any news? |
|
No news yet, someone has to review #5585 before I can continue with my work on the annotation layer. |
|
@timvandermeij Will the work you do on the annotation layer fix the issue described in #3826? |
|
No, my work is more focused on refactoring. This is a bugfix, so I'm not currently working on that. |
Fixes #5018.
Highlight annotations are basically nothing more than the already implemented Text annotations. Therefore a Highlight annotation can be represented as a Text annotation according to the PDF specification at https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf#page=633&zoom=auto,-306,268.
Note that for the issue mentioned in this PR the annotations itself are fixed with this PR, but the annotation content is rotated. This is a separate issue (due to the transform on
annotTextthat also affects child elements such as the annotation content) and I think it also related to #3826. This should be filed as a follow-up issue.