summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Document.h
diff options
context:
space:
mode:
authortonikitoo <tonikitoo@igalia.com>2016-08-08 16:14:05 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-08 16:14:05 -0700
commit1c836753bb86b3eb0e130f1d92868a273bb26ab8 (patch)
tree35a4cc074fc56bd53112492b48dece10e1519470 /fpdfsdk/javascript/Document.h
parent727da4f329956406b936ba9c0bc49ab2d32db67e (diff)
downloadpdfium-1c836753bb86b3eb0e130f1d92868a273bb26ab8.tar.xz
Add support to Document::gotoNamedDest method.
Patch implements the Document's API gotoNamedDest, which is part of the PDF specification [1], page 129, with the following (short) description: "Use this method to go to a named destination within the PDF document". [1] http://partners.adobe.com/public/developer/en/acrobat/sdk/5186AcroJS.pdf "Named destination" is a common concept in the PDF world. It can be used together with PDF's Links, Annotations, Bookmarks and OpenActions, as well as an action per se, in case "this.gotoNamedDest" is called directly. Note that the implementation makes use of the existing hook CPDFDoc_Environment::FFI_DoGoToAction, which ends up calling out the embedder to actually handle it. In case of Chromium, for instance, it calls PDFiumEngine::Form_DoGoToAction which only handles for now the "page" property of the "destination". Other properties, including zoom level, and scroll position are ignored for the moment. BUG=pdfium:492 Review-Url: https://codereview.chromium.org/2221823003
Diffstat (limited to 'fpdfsdk/javascript/Document.h')
-rw-r--r--fpdfsdk/javascript/Document.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fpdfsdk/javascript/Document.h b/fpdfsdk/javascript/Document.h
index ae2d6c1afe..873f70e327 100644
--- a/fpdfsdk/javascript/Document.h
+++ b/fpdfsdk/javascript/Document.h
@@ -207,6 +207,10 @@ class Document : public CJS_EmbedObj {
const std::vector<CJS_Value>& params,
CJS_Value& vRet,
CFX_WideString& sError);
+ FX_BOOL gotoNamedDest(IJS_Context* cc,
+ const std::vector<CJS_Value>& params,
+ CJS_Value& vRet,
+ CFX_WideString& sError);
FX_BOOL importAnFDF(IJS_Context* cc,
const std::vector<CJS_Value>& params,
CJS_Value& vRet,
@@ -356,6 +360,7 @@ class CJS_Document : public CJS_Object {
JS_STATIC_METHOD(getPageNumWords, Document);
JS_STATIC_METHOD(getPrintParams, Document);
JS_STATIC_METHOD(getURL, Document);
+ JS_STATIC_METHOD(gotoNamedDest, Document);
JS_STATIC_METHOD(importAnFDF, Document);
JS_STATIC_METHOD(importAnXFDF, Document);
JS_STATIC_METHOD(importTextData, Document);