From 733e068e077bb59597180bc9b8ff934dd125ffdc Mon Sep 17 00:00:00 2001 From: thestig Date: Wed, 23 Nov 2016 05:52:39 -0800 Subject: Add API for getting page labels. BUG=pdfium:479 Review-Url: https://codereview.chromium.org/2521843003 --- public/fpdf_doc.h | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'public') diff --git a/public/fpdf_doc.h b/public/fpdf_doc.h index 9d2229c0c1..b245d46900 100644 --- a/public/fpdf_doc.h +++ b/public/fpdf_doc.h @@ -281,26 +281,43 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, // Get meta-data |tag| content from |document|. // -// doc - handle to the document -// tag - the tag to retrieve. The tag can be one of: -// Title, Author, Subject, Keywords, Creator, Producer, -// CreationDate, or ModDate. -// For detailed explanations of these tags and their respective -// values, please refer to PDF Reference 1.6, section 10.2.1, -// 'Document Information Dictionary'. -// buffer - a buffer for the title. May be NULL. -// buflen - the length of the buffer, in bytes. May be 0. +// document - handle to the document. +// tag - the tag to retrieve. The tag can be one of: +// Title, Author, Subject, Keywords, Creator, Producer, +// CreationDate, or ModDate. +// For detailed explanations of these tags and their respective +// values, please refer to PDF Reference 1.6, section 10.2.1, +// 'Document Information Dictionary'. +// buffer - a buffer for the tag. May be NULL. +// buflen - the length of the buffer, in bytes. May be 0. // -// Returns the number of bytes in the title, including trailing zeros. +// Returns the number of bytes in the tag, 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 than // the returned length, or |buffer| is NULL, |buffer| will not be modified. -DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc, +DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT document, FPDF_BYTESTRING tag, void* buffer, unsigned long buflen); +// Get the page label for |page_index| from |document|. +// +// document - handle to the document. +// page_index - the 0-based index of the page. +// buffer - a buffer for the page label. May be NULL. +// buflen - the length of the buffer, in bytes. May be 0. +// +// Returns the number of bytes in the page label, 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 than +// the returned length, or |buffer| is NULL, |buffer| will not be modified. +DLLEXPORT unsigned long STDCALL FPDF_GetPagelLabel(FPDF_DOCUMENT document, + int page_index, + void* buffer, + unsigned long buflen); + #ifdef __cplusplus } // extern "C" #endif // __cplusplus -- cgit v1.2.3