From 9c6204fc6c23ab35ec234781df182da570f6faef Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 8 May 2018 19:20:57 +0000 Subject: Add APIs to work with a FPDF_PAGERANGE. After getting a FPDF_PAGERANGE from FPDF_VIEWERREF_GetPrintPageRange(), one can now use FPDF_VIEWERREF_GetPrintPageRangeCount() to get the number of elements in the FPDF_PAGERANGE. One can then use FPDF_VIEWERREF_GetPrintPageRangeElement() to read the elements. Change-Id: I33eeff9026d01991ae1424e05b67f163245a35f9 Reviewed-on: https://pdfium-review.googlesource.com/32173 Commit-Queue: Lei Zhang Reviewed-by: dsinclair --- public/fpdfview.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'public') diff --git a/public/fpdfview.h b/public/fpdfview.h index f8d6026292..7758facc39 100644 --- a/public/fpdfview.h +++ b/public/fpdfview.h @@ -10,6 +10,8 @@ #ifndef PUBLIC_FPDFVIEW_H_ #define PUBLIC_FPDFVIEW_H_ +#include + #if defined(_WIN32) && !defined(__WINDOWS__) #include #endif @@ -1014,6 +1016,28 @@ FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document); FPDF_EXPORT FPDF_PAGERANGE FPDF_CALLCONV FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document); +// Function: FPDF_VIEWERREF_GetPrintPageRangeCount +// Returns the number of elements in a FPDF_PAGERANGE. +// Experimental API. +// Parameters: +// pagerange - Handle to the page range. +// Return value: +// The number of elements in the page range. Returns 0 on error. +FPDF_EXPORT size_t FPDF_CALLCONV +FPDF_VIEWERREF_GetPrintPageRangeCount(FPDF_PAGERANGE pagerange); + +// Function: FPDF_VIEWERREF_GetPrintPageRangeElement +// Returns an element from a FPDF_PAGERANGE. +// Experimental API. +// Parameters: +// pagerange - Handle to the page range. +// index - Index of the element. +// Return value: +// The value of the element in the page range at a given index. +// Returns -1 on error. +FPDF_EXPORT int FPDF_CALLCONV +FPDF_VIEWERREF_GetPrintPageRangeElement(FPDF_PAGERANGE pagerange, size_t index); + // Function: FPDF_VIEWERREF_GetDuplex // Returns the paper handling option to be used when printing from // the print dialog. -- cgit v1.2.3