Commit Graph

1 Commits

Author SHA1 Message Date
Dominic Mazzoni
c227f4a826 Add support for tagging link annotations in PDFs.
Properly tagging links in PDFs just required a small change: at the time
an annotation is drawn, we need to keep track of the bounding rect, the
url and/or named destination, and now additionally the node ID. Instead
of keeping track of separate maps of rects/urls and rects/dests, this
patch combines them into a vector of SkPDFLinks.

Then, at the time the annotation is written to the file, an object
reference to that annotation can be saved and passed to the document
structure tree, where it can be included as an additional child of
the node with that node ID.

That allows for properly tagging the link and optionally giving it alt
text (like for an image link).

Bug: chromium:1039816
Change-Id: I97e47d3c70949020c3e0a69b8c9fc743748f3a7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277426
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-03-24 15:52:55 +00:00