summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2017-04-06 14:44:02 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-08 01:38:54 +0000
commitd9dad3a1915973d113f1f8685474a5a8c1f4faac (patch)
treebd34c61ace230963b1c7f92b30cf025cdd16f380 /fpdfsdk
parent746c28772e01675096800d8853aae33f94ed3d55 (diff)
downloadpdfium-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 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdf_structtree.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_structtree.cpp b/fpdfsdk/fpdf_structtree.cpp
index 96d40b41c2..74c44f8083 100644
--- a/fpdfsdk/fpdf_structtree.cpp
+++ b/fpdfsdk/fpdf_structtree.cpp
@@ -83,6 +83,16 @@ FPDF_StructElement_GetType(FPDF_STRUCTELEMENT struct_element,
: 0;
}
+DLLEXPORT unsigned long STDCALL
+FPDF_StructElement_GetTitle(FPDF_STRUCTELEMENT struct_element,
+ void* buffer,
+ unsigned long buflen) {
+ CPDF_StructElement* elem = ToStructTreeElement(struct_element);
+ return elem
+ ? WideStringToBuffer(elem->GetTitle().UTF8Decode(), buffer, buflen)
+ : 0;
+}
+
DLLEXPORT int STDCALL
FPDF_StructElement_CountChildren(FPDF_STRUCTELEMENT struct_element) {
CPDF_StructElement* elem = ToStructTreeElement(struct_element);