John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1 | // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 4 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 7 | #ifndef PUBLIC_FPDF_DOC_H_ |
| 8 | #define PUBLIC_FPDF_DOC_H_ |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 9 | |
Dan Sinclair | 85c8e7f | 2016-11-21 13:50:32 -0500 | [diff] [blame] | 10 | // NOLINTNEXTLINE(build/include) |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 11 | #include "fpdfview.h" |
| 12 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 13 | #ifdef __cplusplus |
| 14 | extern "C" { |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 15 | #endif // __cplusplus |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 16 | |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 17 | // Unsupported action type. |
| 18 | #define PDFACTION_UNSUPPORTED 0 |
| 19 | // Go to a destination within current document. |
| 20 | #define PDFACTION_GOTO 1 |
| 21 | // Go to a destination within another document. |
| 22 | #define PDFACTION_REMOTEGOTO 2 |
| 23 | // URI, including web pages and other Internet resources. |
| 24 | #define PDFACTION_URI 3 |
| 25 | // Launch an application or open a file. |
| 26 | #define PDFACTION_LAUNCH 4 |
Bo Xu | 4d62b6b | 2015-01-10 22:52:59 -0800 | [diff] [blame] | 27 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 28 | typedef struct _FS_QUADPOINTSF { |
| 29 | FS_FLOAT x1; |
| 30 | FS_FLOAT y1; |
| 31 | FS_FLOAT x2; |
| 32 | FS_FLOAT y2; |
| 33 | FS_FLOAT x3; |
| 34 | FS_FLOAT y3; |
| 35 | FS_FLOAT x4; |
| 36 | FS_FLOAT y4; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 37 | } FS_QUADPOINTSF; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 38 | |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 39 | // Get the first child of |bookmark|, or the first top-level bookmark item. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 40 | // |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 41 | // document - handle to the document. |
| 42 | // bookmark - handle to the current bookmark. Pass NULL for the first top |
| 43 | // level item. |
| 44 | // |
| 45 | // Returns a handle to the first child of |bookmark| or the first top-level |
| 46 | // bookmark item. NULL if no child or top-level bookmark found. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 47 | FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 48 | FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark); |
| 49 | |
| 50 | // Get the next sibling of |bookmark|. |
| 51 | // |
| 52 | // document - handle to the document. |
| 53 | // bookmark - handle to the current bookmark. |
| 54 | // |
| 55 | // Returns a handle to the next sibling of |bookmark|, or NULL if this is the |
| 56 | // last bookmark at this level. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 57 | FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 58 | FPDFBookmark_GetNextSibling(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark); |
| 59 | |
| 60 | // Get the title of |bookmark|. |
| 61 | // |
| 62 | // bookmark - handle to the bookmark. |
| 63 | // buffer - buffer for the title. May be NULL. |
| 64 | // buflen - the length of the buffer in bytes. May be 0. |
| 65 | // |
| 66 | // Returns the number of bytes in the title, including the terminating NUL |
| 67 | // character. The number of bytes is returned regardless of the |buffer| and |
| 68 | // |buflen| parameters. |
| 69 | // |
| 70 | // Regardless of the platform, the |buffer| is always in UTF-16LE encoding. The |
thestig | 9067fd6 | 2016-11-23 14:10:06 -0800 | [diff] [blame] | 71 | // string is terminated by a UTF16 NUL character. If |buflen| is less than the |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 72 | // required length, or |buffer| is NULL, |buffer| will not be modified. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 73 | FPDF_EXPORT unsigned long FPDF_CALLCONV |
| 74 | FPDFBookmark_GetTitle(FPDF_BOOKMARK bookmark, |
| 75 | void* buffer, |
| 76 | unsigned long buflen); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 77 | |
| 78 | // Find the bookmark with |title| in |document|. |
| 79 | // |
| 80 | // document - handle to the document. |
| 81 | // title - the UTF-16LE encoded Unicode title for which to search. |
| 82 | // |
| 83 | // Returns the handle to the bookmark, or NULL if |title| can't be found. |
| 84 | // |
| 85 | // |FPDFBookmark_Find| will always return the first bookmark found even if |
| 86 | // multiple bookmarks have the same |title|. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 87 | FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV |
| 88 | FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 89 | |
| 90 | // Get the destination associated with |bookmark|. |
| 91 | // |
| 92 | // document - handle to the document. |
| 93 | // bookmark - handle to the bookmark. |
| 94 | // |
| 95 | // Returns the handle to the destination data, NULL if no destination is |
| 96 | // associated with |bookmark|. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 97 | FPDF_EXPORT FPDF_DEST FPDF_CALLCONV |
| 98 | FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 99 | |
| 100 | // Get the action associated with |bookmark|. |
| 101 | // |
| 102 | // bookmark - handle to the bookmark. |
| 103 | // |
| 104 | // Returns the handle to the action data, or NULL if no action is associated |
| 105 | // with |bookmark|. When NULL is returned, |FPDFBookmark_GetDest| should be |
| 106 | // called to get the |bookmark| destination data. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 107 | FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV |
| 108 | FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 109 | |
| 110 | // Get the type of |action|. |
| 111 | // |
| 112 | // action - handle to the action. |
| 113 | // |
| 114 | // Returns one of: |
| 115 | // PDFACTION_UNSUPPORTED |
| 116 | // PDFACTION_GOTO |
| 117 | // PDFACTION_REMOTEGOTO |
| 118 | // PDFACTION_URI |
| 119 | // PDFACTION_LAUNCH |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 120 | FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAction_GetType(FPDF_ACTION action); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 121 | |
| 122 | // Get the destination of |action|. |
| 123 | // |
| 124 | // document - handle to the document. |
| 125 | // action - handle to the action. |action| must be a |PDFACTION_GOTO| or |
| 126 | // |PDFACTION_REMOTEGOTO|. |
| 127 | // |
| 128 | // Returns a handle to the destination data. |
| 129 | // |
| 130 | // In the case of |PDFACTION_REMOTEGOTO|, you should first call |
| 131 | // |FPDFAction_GetFilePath| then load that document, the document handle from |
| 132 | // that document should pass as |document| to |FPDFAction_GetDest|. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 133 | FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFAction_GetDest(FPDF_DOCUMENT document, |
| 134 | FPDF_ACTION action); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 135 | |
| 136 | // Get file path of a |PDFACTION_REMOTEGOTO| |action|. |
| 137 | // |
| 138 | // action - handle to the action. |action| must be a |PDFACTION_LAUNCH| or |
| 139 | // |PDFACTION_REMOTEGOTO| |
| 140 | // buffer - a buffer for output the path string. May be NULL. |
| 141 | // buflen - the length of the buffer, in bytes. May be 0. |
| 142 | // |
Lei Zhang | d3b90ac | 2017-06-08 18:48:10 -0700 | [diff] [blame] | 143 | // Returns the number of bytes in the file path, including the trailing NUL |
| 144 | // character. |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 145 | // |
Lei Zhang | d3b90ac | 2017-06-08 18:48:10 -0700 | [diff] [blame] | 146 | // Regardless of the platform, the |buffer| is always in UTF-8 encoding. |
thestig | 9067fd6 | 2016-11-23 14:10:06 -0800 | [diff] [blame] | 147 | // If |buflen| is less than the returned length, or |buffer| is NULL, |buffer| |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 148 | // will not be modified. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 149 | FPDF_EXPORT unsigned long FPDF_CALLCONV |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 150 | FPDFAction_GetFilePath(FPDF_ACTION action, void* buffer, unsigned long buflen); |
| 151 | |
| 152 | // Get the URI path of a |PDFACTION_URI| |action|. |
| 153 | // |
| 154 | // document - handle to the document. |
| 155 | // action - handle to the action. Must be a |PDFACTION_URI|. |
| 156 | // buffer - a buffer for the path string. May be NULL. |
| 157 | // buflen - the length of the buffer, in bytes. May be 0. |
| 158 | // |
| 159 | // Returns the number of bytes in the URI path, including trailing zeros. |
| 160 | // |
thestig | 9067fd6 | 2016-11-23 14:10:06 -0800 | [diff] [blame] | 161 | // The |buffer| is always encoded in 7-bit ASCII. If |buflen| is less than the |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 162 | // returned length, or |buffer| is NULL, |buffer| will not be modified. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 163 | FPDF_EXPORT unsigned long FPDF_CALLCONV |
| 164 | FPDFAction_GetURIPath(FPDF_DOCUMENT document, |
| 165 | FPDF_ACTION action, |
| 166 | void* buffer, |
| 167 | unsigned long buflen); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 168 | |
| 169 | // Get the page index of |dest|. |
| 170 | // |
| 171 | // document - handle to the document. |
| 172 | // dest - handle to the destination. |
| 173 | // |
| 174 | // Returns the page index containing |dest|. Page indices start from 0. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 175 | FPDF_EXPORT unsigned long FPDF_CALLCONV |
| 176 | FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 177 | |
dsinclair | c59fa88 | 2016-11-08 06:55:40 -0800 | [diff] [blame] | 178 | // Get the (x, y, zoom) location of |dest| in the destination page, if the |
| 179 | // destination is in [page /XYZ x y zoom] syntax. |
| 180 | // |
| 181 | // dest - handle to the destination. |
| 182 | // hasXVal - out parameter; true if the x value is not null |
| 183 | // hasYVal - out parameter; true if the y value is not null |
| 184 | // hasZoomVal - out parameter; true if the zoom value is not null |
| 185 | // x - out parameter; the x coordinate, in page coordinates. |
| 186 | // y - out parameter; the y coordinate, in page coordinates. |
| 187 | // zoom - out parameter; the zoom value. |
| 188 | // Returns TRUE on successfully reading the /XYZ value. |
| 189 | // |
| 190 | // Note the [x, y, zoom] values are only set if the corresponding hasXVal, |
| 191 | // hasYVal or hasZoomVal flags are true. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 192 | FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV |
| 193 | FPDFDest_GetLocationInPage(FPDF_DEST dest, |
| 194 | FPDF_BOOL* hasXCoord, |
| 195 | FPDF_BOOL* hasYCoord, |
| 196 | FPDF_BOOL* hasZoom, |
| 197 | FS_FLOAT* x, |
| 198 | FS_FLOAT* y, |
| 199 | FS_FLOAT* zoom); |
dsinclair | c59fa88 | 2016-11-08 06:55:40 -0800 | [diff] [blame] | 200 | |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 201 | // Find a link at point (|x|,|y|) on |page|. |
| 202 | // |
| 203 | // page - handle to the document page. |
| 204 | // x - the x coordinate, in the page coordinate system. |
| 205 | // y - the y coordinate, in the page coordinate system. |
| 206 | // |
| 207 | // Returns a handle to the link, or NULL if no link found at the given point. |
| 208 | // |
| 209 | // You can convert coordinates from screen coordinates to page coordinates using |
| 210 | // |FPDF_DeviceToPage|. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 211 | FPDF_EXPORT FPDF_LINK FPDF_CALLCONV FPDFLink_GetLinkAtPoint(FPDF_PAGE page, |
| 212 | double x, |
| 213 | double y); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 214 | |
| 215 | // Find the Z-order of link at point (|x|,|y|) on |page|. |
| 216 | // |
| 217 | // page - handle to the document page. |
| 218 | // x - the x coordinate, in the page coordinate system. |
| 219 | // y - the y coordinate, in the page coordinate system. |
| 220 | // |
| 221 | // Returns the Z-order of the link, or -1 if no link found at the given point. |
| 222 | // Larger Z-order numbers are closer to the front. |
| 223 | // |
| 224 | // You can convert coordinates from screen coordinates to page coordinates using |
| 225 | // |FPDF_DeviceToPage|. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 226 | FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, |
| 227 | double x, |
| 228 | double y); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 229 | |
| 230 | // Get destination info for |link|. |
| 231 | // |
| 232 | // document - handle to the document. |
| 233 | // link - handle to the link. |
| 234 | // |
| 235 | // Returns a handle to the destination, or NULL if there is no destination |
| 236 | // associated with the link. In this case, you should call |FPDFLink_GetAction| |
| 237 | // to retrieve the action associated with |link|. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 238 | FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFLink_GetDest(FPDF_DOCUMENT document, |
| 239 | FPDF_LINK link); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 240 | |
| 241 | // Get action info for |link|. |
| 242 | // |
| 243 | // link - handle to the link. |
| 244 | // |
| 245 | // Returns a handle to the action associated to |link|, or NULL if no action. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 246 | FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV FPDFLink_GetAction(FPDF_LINK link); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 247 | |
| 248 | // Enumerates all the link annotations in |page|. |
| 249 | // |
| 250 | // page - handle to the page. |
| 251 | // startPos - the start position, should initially be 0 and is updated with |
| 252 | // the next start position on return. |
| 253 | // linkAnnot - the link handle for |startPos|. |
| 254 | // |
| 255 | // Returns TRUE on success. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 256 | FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_Enumerate(FPDF_PAGE page, |
| 257 | int* startPos, |
| 258 | FPDF_LINK* linkAnnot); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 259 | |
| 260 | // Get the rectangle for |linkAnnot|. |
| 261 | // |
| 262 | // linkAnnot - handle to the link annotation. |
| 263 | // rect - the annotation rectangle. |
| 264 | // |
| 265 | // Returns true on success. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 266 | FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, |
| 267 | FS_RECTF* rect); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 268 | |
| 269 | // Get the count of quadrilateral points to the |linkAnnot|. |
| 270 | // |
| 271 | // linkAnnot - handle to the link annotation. |
| 272 | // |
| 273 | // Returns the count of quadrilateral points. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 274 | FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot); |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 275 | |
| 276 | // Get the quadrilateral points for the specified |quadIndex| in |linkAnnot|. |
| 277 | // |
| 278 | // linkAnnot - handle to the link annotation. |
| 279 | // quadIndex - the specified quad point index. |
| 280 | // quadPoints - receives the quadrilateral points. |
| 281 | // |
| 282 | // Returns true on success. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 283 | FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV |
| 284 | FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, |
| 285 | int quadIndex, |
| 286 | FS_QUADPOINTSF* quadPoints); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 287 | |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 288 | // Get meta-data |tag| content from |document|. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 289 | // |
thestig | 733e068 | 2016-11-23 05:52:39 -0800 | [diff] [blame] | 290 | // document - handle to the document. |
| 291 | // tag - the tag to retrieve. The tag can be one of: |
| 292 | // Title, Author, Subject, Keywords, Creator, Producer, |
| 293 | // CreationDate, or ModDate. |
| 294 | // For detailed explanations of these tags and their respective |
| 295 | // values, please refer to PDF Reference 1.6, section 10.2.1, |
| 296 | // 'Document Information Dictionary'. |
| 297 | // buffer - a buffer for the tag. May be NULL. |
| 298 | // buflen - the length of the buffer, in bytes. May be 0. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 299 | // |
thestig | 733e068 | 2016-11-23 05:52:39 -0800 | [diff] [blame] | 300 | // Returns the number of bytes in the tag, including trailing zeros. |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 301 | // |
| 302 | // The |buffer| is always encoded in UTF-16LE. The |buffer| is followed by two |
thestig | 04bebfe | 2016-11-04 16:07:25 -0700 | [diff] [blame] | 303 | // bytes of zeros indicating the end of the string. If |buflen| is less than |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 304 | // the returned length, or |buffer| is NULL, |buffer| will not be modified. |
Henrique Nakashima | 10e02fa | 2017-06-22 16:14:09 -0400 | [diff] [blame] | 305 | // |
| 306 | // For linearized files, FPDFAvail_IsFormAvail must be called before this, and |
| 307 | // it must have returned PDF_FORM_AVAIL or PDF_FORM_NOTEXIST. Before that, there |
| 308 | // is no guarantee the metadata has been loaded. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 309 | FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetMetaText(FPDF_DOCUMENT document, |
| 310 | FPDF_BYTESTRING tag, |
| 311 | void* buffer, |
| 312 | unsigned long buflen); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 313 | |
thestig | 733e068 | 2016-11-23 05:52:39 -0800 | [diff] [blame] | 314 | // Get the page label for |page_index| from |document|. |
| 315 | // |
| 316 | // document - handle to the document. |
| 317 | // page_index - the 0-based index of the page. |
| 318 | // buffer - a buffer for the page label. May be NULL. |
| 319 | // buflen - the length of the buffer, in bytes. May be 0. |
| 320 | // |
| 321 | // Returns the number of bytes in the page label, including trailing zeros. |
| 322 | // |
| 323 | // The |buffer| is always encoded in UTF-16LE. The |buffer| is followed by two |
| 324 | // bytes of zeros indicating the end of the string. If |buflen| is less than |
| 325 | // the returned length, or |buffer| is NULL, |buffer| will not be modified. |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 326 | FPDF_EXPORT unsigned long FPDF_CALLCONV |
| 327 | FPDF_GetPageLabel(FPDF_DOCUMENT document, |
| 328 | int page_index, |
| 329 | void* buffer, |
| 330 | unsigned long buflen); |
thestig | 733e068 | 2016-11-23 05:52:39 -0800 | [diff] [blame] | 331 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 332 | #ifdef __cplusplus |
dsinclair | 5f597db | 2016-03-25 09:04:54 -0700 | [diff] [blame] | 333 | } // extern "C" |
| 334 | #endif // __cplusplus |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 335 | |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 336 | #endif // PUBLIC_FPDF_DOC_H_ |