diff options
author | dan sinclair <dsinclair@chromium.org> | 2017-04-06 14:44:02 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-08 01:38:54 +0000 |
commit | d9dad3a1915973d113f1f8685474a5a8c1f4faac (patch) | |
tree | bd34c61ace230963b1c7f92b30cf025cdd16f380 /samples/pdfium_test.cc | |
parent | 746c28772e01675096800d8853aae33f94ed3d55 (diff) | |
download | pdfium-d9dad3a1915973d113f1f8685474a5a8c1f4faac.tar.xz |
Add title (/T) extraction for PDF tagged structureschromium/3067chromium/3066
This CL adds the ability to extract the title from a tagged structure element if
one exists.
Bug: pdfium:672
Change-Id: I22e2a8371db4f08b8a70dd77002f1befab97f530
Reviewed-on: https://pdfium-review.googlesource.com/3819
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'samples/pdfium_test.cc')
-rw-r--r-- | samples/pdfium_test.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc index 1dc76fee5b..d2b3c01196 100644 --- a/samples/pdfium_test.cc +++ b/samples/pdfium_test.cc @@ -641,6 +641,11 @@ void DumpChildStructure(FPDF_STRUCTELEMENT child, int indent) { printf("%*s%ls", indent * 2, "", ConvertToWString(buf, len).c_str()); memset(buf, 0, sizeof(buf)); + len = FPDF_StructElement_GetTitle(child, buf, kBufSize); + if (len > 0) + printf(": '%ls'", ConvertToWString(buf, len).c_str()); + + memset(buf, 0, sizeof(buf)); len = FPDF_StructElement_GetAltText(child, buf, kBufSize); if (len > 0) printf(" (%ls)", ConvertToWString(buf, len).c_str()); |