Repository navigation
Implement constants for all annotation types - #6757
Conversation
There was a problem hiding this comment.
According to http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#G11.1994590, there's also one annotation type called Redact.
There was a problem hiding this comment.
You are right, it is new as of PDF 1.7. It was not in https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf, hence why I missed it. Thank you for noticing, I will add it!
|
r=me, with comment addressed. |
Now we have a full list of all possible annotation types and the numbering corresponds to the order in the specification. Not only is this more consistent and complete, it also prevents having to add these constants when a new annotation type is implemented. Additionally fix an issue where a regular Widget annotation would not have `data.annotationType` set. It was only set for a TextWidgetAnnotation, but instead move it to the base Widget annotation class to add it for all Widget annotations (since TextWidgetAnnotation inherits from WidgetAnnotation it will have it too).
95188c8 to
8d36aad
Compare
|
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 |
|
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 |
From: Bot.io (Windows)SuccessTotal script time: 19.23 mins
|
From: Bot.io (Linux)SuccessTotal script time: 19.92 mins
|
|
Merging with r=Snuffleupagus (see above, now that the comment is addressed) and r=me (since it's a trivial patch). |
Implement constants for all annotation types
Now we have a full list of all possible annotation types and the numbering corresponds to the order in the specification. Not only is this more consistent and complete, it also prevents having to add these constants when a new annotation type is implemented.
Additionally fix an issue where a regular Widget annotation would not have
data.annotationTypeset. It was only set for a TextWidgetAnnotation, but instead move it to the base Widget annotation class to add it for all Widget annotations (since TextWidgetAnnotation inherits from WidgetAnnotation it will have it too).This is another part of #5218. I have tested this PR with a set of 20 PDF files with various kinds of annotations (Link, Text, Widget, et cetera) and found no changes in rendering, behavior or printing.