Tagged PDFs should output an IDTree.

The PDF spec requires that tagged PDFs have a unique
alphanumeric ID for each structure element node, and an
IDTree structure that maps IDs to an indirect reference
to the PDF node containing that element.

This patch adds support for the IDTree, and also fixes
the IDs we output for each node to be strings (not names)
and makes them zero-padded so that we can easily output
the IDs in sorted lexicographic order by making that match
numeric order.

PDFs output by Skia now pass CommonLook's
Integrity Validator; these ID issues were flagged
as errors previously.

Bug: chromium:607777
Bug: skia:8148
Change-Id: I9b367fe90aa018c21f34abd186e83c53cdde34cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291689
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
2 files changed