Index: pdf/pdfium/pdfium_engine.cc |
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc |
index e44b2dc18b80f0582b406164c5e2a00d0054d336..ffe8ee9c421489cbd1c0d57ec59ce3381a15db60 100644 |
--- a/pdf/pdfium/pdfium_engine.cc |
+++ b/pdf/pdfium/pdfium_engine.cc |
@@ -427,6 +427,18 @@ pp::VarDictionary TraverseBookmarks(FPDF_DOCUMENT doc, |
if (dest) { |
int page_index = FPDFDest_GetPageIndex(doc, dest); |
dict.Set(pp::Var("page"), pp::Var(page_index)); |
+ } else { |
+ // Extract URI for bookmarks linking to an external page. |
+ FPDF_ACTION action = FPDFBookmark_GetAction(bookmark); |
+ buffer_size = FPDFAction_GetURIPath(doc, action, NULL, 0); |
raymes
2016/02/01 04:44:32
nit: nullptr
tsergeant
2016/02/01 06:01:00
Done (and the one above)
|
+ std::string uri; |
raymes
2016/02/01 04:44:32
nit: move into if statement
tsergeant
2016/02/01 06:01:00
Done.
|
+ if (buffer_size > 0) { |
+ PDFiumAPIStringBufferAdapter<std::string> |
+ api_string_adapter(&uri, buffer_size, true); |
+ api_string_adapter.Close(FPDFAction_GetURIPath( |
+ doc, action, api_string_adapter.GetData(), buffer_size)); |
+ dict.Set(pp::Var("uri"), pp::Var(uri)); |
+ } |
} |
pp::VarArray children; |