summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-11-04 16:07:25 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-04 16:07:25 -0700
commit04bebfe590d6d27a825b881fd234e31501843edc (patch)
tree127477b084005457579c599b2ec9eef0668a1479 /public
parent931d087b991a986cc8bfa72131fe8eda0d987fc4 (diff)
downloadpdfium-04bebfe590d6d27a825b881fd234e31501843edc.tar.xz
Implement FPDF_VIEWERREF_GetName() API.chromium/2910
This is a generic API function to retrieve any viewer preference of type name. BUG=pdfium:414 Review-Url: https://codereview.chromium.org/2475923003
Diffstat (limited to 'public')
-rw-r--r--public/fpdf_doc.h2
-rw-r--r--public/fpdfview.h19
2 files changed, 20 insertions, 1 deletions
diff --git a/public/fpdf_doc.h b/public/fpdf_doc.h
index 0b78743259..c3be0e0598 100644
--- a/public/fpdf_doc.h
+++ b/public/fpdf_doc.h
@@ -271,7 +271,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot,
// Returns the number of bytes in the title, including trailing zeros.
//
// The |buffer| is always encoded in UTF-16LE. The |buffer| is followed by two
-// bytes of zeros indicating the end of the string. If |buflen| is less then
+// bytes of zeros indicating the end of the string. If |buflen| is less than
// the returned length, or |buffer| is NULL, |buffer| will not be modified.
DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc,
FPDF_BYTESTRING tag,
diff --git a/public/fpdfview.h b/public/fpdfview.h
index 499124d6e8..469053c4e8 100644
--- a/public/fpdfview.h
+++ b/public/fpdfview.h
@@ -914,6 +914,25 @@ FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document);
DLLEXPORT FPDF_DUPLEXTYPE STDCALL
FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document);
+// Function: FPDF_VIEWERREF_GetName
+// Gets the contents for a viewer ref, with a given key. The value must
+// be of type "name".
+// Parameters:
+// document - Handle to the loaded document.
+// key - Name of the key in the viewer pref dictionary.
+// buffer - A string to write the contents of the key to.
+// length - Length of the buffer.
+// Return value:
+// The number of bytes in the contents, including the NULL terminator.
+// Thus if the return value is 0, then that indicates an error, such
+// as when |document| is invalid or |buffer| is NULL. If |length| is
+// less than the returned length, or |buffer| is NULL, |buffer| will
+// not be modified.
+DLLEXPORT unsigned long STDCALL FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document,
+ FPDF_BYTESTRING key,
+ char* buffer,
+ unsigned long length);
+
// Function: FPDF_CountNamedDests
// Get the count of named destinations in the PDF document.
// Parameters: