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.
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
7 // NOTE: External docs refer to this file as "fpdfview.h", so do not rename
8 // despite lack of consitency with other public files.
10 #ifndef PUBLIC_FPDFVIEW_H_
11 #define PUBLIC_FPDFVIEW_H_
13 #if defined(_WIN32) && !defined(__WINDOWS__)
18 typedef void* FPDF_MODULEMGR;
21 typedef void* FPDF_DOCUMENT;
22 typedef void* FPDF_PAGE;
23 typedef void* FPDF_PAGEOBJECT; // Page object(text, path, etc)
24 typedef void* FPDF_PATH;
25 typedef void* FPDF_CLIPPATH;
26 typedef void* FPDF_BITMAP;
27 typedef void* FPDF_FONT;
28 typedef void* FPDF_TEXTPAGE;
29 typedef void* FPDF_SCHHANDLE;
30 typedef void* FPDF_PAGELINK;
31 typedef void* FPDF_HMODULE;
32 typedef void* FPDF_DOCSCHHANDLE;
33 typedef void* FPDF_BOOKMARK;
34 typedef void* FPDF_DEST;
35 typedef void* FPDF_ACTION;
36 typedef void* FPDF_LINK;
37 typedef void* FPDF_PAGERANGE;
40 typedef int FPDF_BOOL;
41 typedef int FPDF_ERROR;
42 typedef unsigned long FPDF_DWORD;
43 typedef float FS_FLOAT;
46 typedef enum _FPDF_DUPLEXTYPE_ {
54 typedef unsigned short FPDF_WCHAR;
55 typedef unsigned char const* FPDF_LPCBYTE;
57 // FPDFSDK may use three types of strings: byte string, wide string (UTF-16LE encoded), and platform dependent string
58 typedef const char* FPDF_BYTESTRING;
60 typedef const unsigned short* FPDF_WIDESTRING; // Foxit PDF SDK always use UTF-16LE encoding wide string,
61 // each character use 2 bytes (except surrogation), with low byte first.
63 // For Windows programmers: for most case it's OK to treat FPDF_WIDESTRING as Windows unicode string,
64 // however, special care needs to be taken if you expect to process Unicode larger than 0xffff.
65 // For Linux/Unix programmers: most compiler/library environment uses 4 bytes for a Unicode character,
66 // you have to convert between FPDF_WIDESTRING and system wide string by yourself.
69 typedef const unsigned short* FPDF_STRING;
71 typedef const char* FPDF_STRING;
74 /** @brief Matrix for transformation. */
75 typedef struct _FS_MATRIX_
77 float a; /**< @brief Coefficient a.*/
78 float b; /**< @brief Coefficient b.*/
79 float c; /**< @brief Coefficient c.*/
80 float d; /**< @brief Coefficient d.*/
81 float e; /**< @brief Coefficient e.*/
82 float f; /**< @brief Coefficient f.*/
85 /** @brief Rectangle area(float) in device or page coordination system. */
86 typedef struct _FS_RECTF_
89 /** @brief The x-coordinate of the left-top corner. */
91 /** @brief The y-coordinate of the left-top corner. */
93 /** @brief The x-coordinate of the right-bottom corner. */
95 /** @brief The y-coordinate of the right-bottom corner. */
98 }* FS_LPRECTF, FS_RECTF;
99 /** @brief Const Pointer to ::FS_RECTF structure.*/
100 typedef const FS_RECTF* FS_LPCRECTF;
102 #if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
103 // On Windows system, functions are exported in a DLL
104 #define DLLEXPORT __declspec( dllexport )
105 #define STDCALL __stdcall
111 // Exported Functions
116 // Function: FPDF_InitLibrary
117 // Initialize the FPDFSDK library
123 // You have to call this function before you can call any PDF processing functions.
124 DLLEXPORT void STDCALL FPDF_InitLibrary();
126 // Function: FPDF_DestroyLibary
127 // Release all resources allocated by the FPDFSDK library.
133 // You can call this function to release all memory blocks allocated by the library.
134 // After this function called, you should not call any PDF processing functions.
135 DLLEXPORT void STDCALL FPDF_DestroyLibrary();
137 //Policy for accessing the local machine time.
138 #define FPDF_POLICY_MACHINETIME_ACCESS 0
140 // Function: FPDF_SetSandBoxPolicy
141 // Set the policy for the sandbox environment.
143 // policy - The specified policy for setting, for example:FPDF_POLICY_MACHINETIME_ACCESS.
144 // enable - True for enable, False for disable the policy.
147 DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable);
149 // Function: FPDF_LoadDocument
150 // Open and load a PDF document.
152 // file_path [in] - Path to the PDF file (including extension).
153 // password [in] - A string used as the password for PDF file.
154 // If no password needed, empty or NULL can be used.
156 // A handle to the loaded document, or NULL on failure.
158 // Loaded document can be closed by FPDF_CloseDocument().
159 // If this function fails, you can use FPDF_GetLastError() to retrieve
160 // the reason why it failed.
161 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
162 FPDF_BYTESTRING password);
164 // Function: FPDF_LoadMemDocument
165 // Open and load a PDF document from memory.
167 // data_buf - Pointer to a buffer containing the PDF document.
168 // size - Number of bytes in the PDF document.
169 // password - A string used as the password for PDF file.
170 // If no password needed, empty or NULL can be used.
172 // A handle to the loaded document. If failed, NULL is returned.
174 // The memory buffer must remain valid when the document is open.
175 // Loaded document can be closed by FPDF_CloseDocument.
176 // If this function fails, you can use FPDF_GetLastError() to retrieve
177 // the reason why it fails.
179 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf,
180 int size, FPDF_BYTESTRING password);
182 // Structure for custom file access.
184 // File length, in bytes.
185 unsigned long m_FileLen;
187 // A function pointer for getting a block of data from specific position.
188 // Position is specified by byte offset from beginning of the file.
189 // The position and size will never go out range of file length.
190 // It may be possible for FPDFSDK to call this function multiple times for same position.
191 // Return value: should be non-zero if successful, zero for error.
192 int (*m_GetBlock)(void* param, unsigned long position, unsigned char* pBuf, unsigned long size);
194 // A custom pointer for all implementation specific data.
195 // This pointer will be used as the first parameter to m_GetBlock callback.
199 // Function: FPDF_LoadCustomDocument
200 // Load PDF document from a custom access descriptor.
202 // pFileAccess - A structure for access the file.
203 // password - Optional password for decrypting the PDF file.
205 // A handle to the loaded document. If failed, NULL is returned.
207 // The application should maintain the file resources being valid until the PDF document close.
208 // Loaded document can be closed by FPDF_CloseDocument.
209 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess,
210 FPDF_BYTESTRING password);
212 // Function: FPDF_GetFileVersion
213 // Get the file version of the specific PDF document.
215 // doc - Handle to document.
216 // fileVersion - The PDF file version. File version: 14 for 1.4, 15 for 1.5, ...
218 // TRUE if this call succeed, If failed, FALSE is returned.
220 // If the document is created by function ::FPDF_CreateNewDocument, then this function would always fail.
221 DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, int* fileVersion);
223 #define FPDF_ERR_SUCCESS 0 // No error.
224 #define FPDF_ERR_UNKNOWN 1 // Unknown error.
225 #define FPDF_ERR_FILE 2 // File not found or could not be opened.
226 #define FPDF_ERR_FORMAT 3 // File not in PDF format or corrupted.
227 #define FPDF_ERR_PASSWORD 4 // Password required or incorrect password.
228 #define FPDF_ERR_SECURITY 5 // Unsupported security scheme.
229 #define FPDF_ERR_PAGE 6 // Page not found or content error.
231 // Function: FPDF_GetLastError
232 // Get last error code when an SDK function failed.
236 // A 32-bit integer indicating error codes (defined above).
238 // If the previous SDK call succeeded, the return value of this function
241 DLLEXPORT unsigned long STDCALL FPDF_GetLastError();
243 // Function: FPDF_GetDocPermission
244 // Get file permission flags of the document.
246 // document - Handle to document. Returned by FPDF_LoadDocument function.
248 // A 32-bit integer indicating permission flags. Please refer to PDF Reference for
249 // detailed description. If the document is not protected, 0xffffffff will be returned.
251 DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document);
253 // Function: FPDF_GetSecurityHandlerRevision
254 // Get the revision for security handler.
256 // document - Handle to document. Returned by FPDF_LoadDocument function.
258 // The security handler revision number. Please refer to PDF Reference for
259 // detailed description. If the document is not protected, -1 will be returned.
261 DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document);
263 // Function: FPDF_GetPageCount
264 // Get total number of pages in a document.
266 // document - Handle to document. Returned by FPDF_LoadDocument function.
268 // Total number of pages in the document.
270 DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document);
272 // Function: FPDF_LoadPage
273 // Load a page inside a document.
275 // document - Handle to document. Returned by FPDF_LoadDocument function.
276 // page_index - Index number of the page. 0 for the first page.
278 // A handle to the loaded page. If failed, NULL is returned.
280 // Loaded page can be rendered to devices using FPDF_RenderPage function.
281 // Loaded page can be closed by FPDF_ClosePage.
283 DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, int page_index);
285 // Function: FPDF_GetPageWidth
288 // page - Handle to the page. Returned by FPDF_LoadPage function.
290 // Page width (excluding non-displayable area) measured in points.
291 // One point is 1/72 inch (around 0.3528 mm).
293 DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page);
295 // Function: FPDF_GetPageHeight
298 // page - Handle to the page. Returned by FPDF_LoadPage function.
300 // Page height (excluding non-displayable area) measured in points.
301 // One point is 1/72 inch (around 0.3528 mm)
303 DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page);
305 // Function: FPDF_GetPageSizeByIndex
306 // Get the size of a page by index.
308 // document - Handle to document. Returned by FPDF_LoadDocument function.
309 // page_index - Page index, zero for the first page.
310 // width - Pointer to a double value receiving the page width (in points).
311 // height - Pointer to a double value receiving the page height (in points).
313 // Non-zero for success. 0 for error (document or page not found).
315 DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_index, double* width, double* height);
317 // Page rendering flags. They can be combined with bit OR.
318 #define FPDF_ANNOT 0x01 // Set if annotations are to be rendered.
319 #define FPDF_LCD_TEXT 0x02 // Set if using text rendering optimized for LCD display.
320 #define FPDF_NO_NATIVETEXT 0x04 // Don't use the native text output available on some platforms
321 #define FPDF_GRAYSCALE 0x08 // Grayscale output.
322 #define FPDF_DEBUG_INFO 0x80 // Set if you want to get some debug info.
323 // Please discuss with Foxit first if you need to collect debug info.
324 #define FPDF_NO_CATCH 0x100 // Set if you don't want to catch exception.
325 #define FPDF_RENDER_LIMITEDIMAGECACHE 0x200 // Limit image cache size.
326 #define FPDF_RENDER_FORCEHALFTONE 0x400 // Always use halftone for image stretching.
327 #define FPDF_PRINTING 0x800 // Render for printing.
328 #define FPDF_RENDER_NO_SMOOTHTEXT 0x1000 // Set to disable anti-aliasing on text.
329 #define FPDF_RENDER_NO_SMOOTHIMAGE 0x2000 // Set to disable anti-aliasing on images.
330 #define FPDF_RENDER_NO_SMOOTHPATH 0x4000 // Set to disable anti-aliasing on paths.
331 #define FPDF_REVERSE_BYTE_ORDER 0x10 //set whether render in a reverse Byte order, this flag only
332 //enable when render to a bitmap.
334 // Function: FPDF_RenderPage
335 // Render contents in a page to a device (screen, bitmap, or printer).
336 // This function is only supported on Windows system.
338 // dc - Handle to device context.
339 // page - Handle to the page. Returned by FPDF_LoadPage function.
340 // start_x - Left pixel position of the display area in the device coordinate.
341 // start_y - Top pixel position of the display area in the device coordinate.
342 // size_x - Horizontal size (in pixels) for displaying the page.
343 // size_y - Vertical size (in pixels) for displaying the page.
344 // rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
345 // 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
346 // flags - 0 for normal display, or combination of flags defined above.
350 DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
351 int rotate, int flags);
354 // Function: FPDF_RenderPageBitmap
355 // Render contents in a page to a device independent bitmap
357 // bitmap - Handle to the device independent bitmap (as the output buffer).
358 // Bitmap handle can be created by FPDFBitmap_Create function.
359 // page - Handle to the page. Returned by FPDF_LoadPage function.
360 // start_x - Left pixel position of the display area in the bitmap coordinate.
361 // start_y - Top pixel position of the display area in the bitmap coordinate.
362 // size_x - Horizontal size (in pixels) for displaying the page.
363 // size_y - Vertical size (in pixels) for displaying the page.
364 // rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
365 // 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
366 // flags - 0 for normal display, or combination of flags defined above.
370 DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y,
371 int size_x, int size_y, int rotate, int flags);
373 // Function: FPDF_ClosePage
374 // Close a loaded PDF page.
376 // page - Handle to the loaded page.
380 DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page);
382 // Function: FPDF_CloseDocument
383 // Close a loaded PDF document.
385 // document - Handle to the loaded document.
389 DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document);
391 // Function: FPDF_DeviceToPage
392 // Convert the screen coordinate of a point to page coordinate.
394 // page - Handle to the page. Returned by FPDF_LoadPage function.
395 // start_x - Left pixel position of the display area in the device coordinate.
396 // start_y - Top pixel position of the display area in the device coordinate.
397 // size_x - Horizontal size (in pixels) for displaying the page.
398 // size_y - Vertical size (in pixels) for displaying the page.
399 // rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
400 // 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
401 // device_x - X value in device coordinate, for the point to be converted.
402 // device_y - Y value in device coordinate, for the point to be converted.
403 // page_x - A Pointer to a double receiving the converted X value in page coordinate.
404 // page_y - A Pointer to a double receiving the converted Y value in page coordinate.
408 // The page coordinate system has its origin at left-bottom corner of the page, with X axis goes along
409 // the bottom side to the right, and Y axis goes along the left side upward. NOTE: this coordinate system
410 // can be altered when you zoom, scroll, or rotate a page, however, a point on the page should always have
411 // the same coordinate values in the page coordinate system.
413 // The device coordinate system is device dependent. For screen device, its origin is at left-top
414 // corner of the window. However this origin can be altered by Windows coordinate transformation
415 // utilities. You must make sure the start_x, start_y, size_x, size_y and rotate parameters have exactly
416 // same values as you used in FPDF_RenderPage() function call.
418 DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
419 int rotate, int device_x, int device_y, double* page_x, double* page_y);
421 // Function: FPDF_PageToDevice
422 // Convert the page coordinate of a point to screen coordinate.
424 // page - Handle to the page. Returned by FPDF_LoadPage function.
425 // start_x - Left pixel position of the display area in the device coordinate.
426 // start_y - Top pixel position of the display area in the device coordinate.
427 // size_x - Horizontal size (in pixels) for displaying the page.
428 // size_y - Vertical size (in pixels) for displaying the page.
429 // rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
430 // 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
431 // page_x - X value in page coordinate, for the point to be converted.
432 // page_y - Y value in page coordinate, for the point to be converted.
433 // device_x - A pointer to an integer receiving the result X value in device coordinate.
434 // device_y - A pointer to an integer receiving the result Y value in device coordinate.
438 // See comments of FPDF_DeviceToPage() function.
440 DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
441 int rotate, double page_x, double page_y, int* device_x, int* device_y);
443 // Function: FPDFBitmap_Create
444 // Create a Foxit Device Independent Bitmap (FXDIB).
446 // width - Number of pixels in a horizontal line of the bitmap. Must be greater than 0.
447 // height - Number of pixels in a vertical line of the bitmap. Must be greater than 0.
448 // alpha - A flag indicating whether alpha channel is used. Non-zero for using alpha, zero for not using.
450 // The created bitmap handle, or NULL if parameter error or out of memory.
452 // An FXDIB always use 4 byte per pixel. The first byte of a pixel is always double word aligned.
453 // Each pixel contains red (R), green (G), blue (B) and optionally alpha (A) values.
454 // The byte order is BGRx (the last byte unused if no alpha channel) or BGRA.
456 // The pixels in a horizontal line (also called scan line) are stored side by side, with left most
457 // pixel stored first (with lower memory address). Each scan line uses width*4 bytes.
459 // Scan lines are stored one after another, with top most scan line stored first. There is no gap
460 // between adjacent scan lines.
462 // This function allocates enough memory for holding all pixels in the bitmap, but it doesn't
463 // initialize the buffer. Applications can use FPDFBitmap_FillRect to fill the bitmap using any color.
464 DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, int height, int alpha);
467 #define FPDFBitmap_Gray 1 // Gray scale bitmap, one byte per pixel.
468 #define FPDFBitmap_BGR 2 // 3 bytes per pixel, byte order: blue, green, red.
469 #define FPDFBitmap_BGRx 3 // 4 bytes per pixel, byte order: blue, green, red, unused.
470 #define FPDFBitmap_BGRA 4 // 4 bytes per pixel, byte order: blue, green, red, alpha.
472 // Function: FPDFBitmap_CreateEx
473 // Create a Foxit Device Independent Bitmap (FXDIB)
475 // width - Number of pixels in a horizontal line of the bitmap. Must be greater than 0.
476 // height - Number of pixels in a vertical line of the bitmap. Must be greater than 0.
477 // format - A number indicating for bitmap format, as defined above.
478 // first_scan - A pointer to the first byte of first scan line, for external buffer
479 // only. If this parameter is NULL, then the SDK will create its own buffer.
480 // stride - Number of bytes for each scan line, for external buffer only..
482 // The created bitmap handle, or NULL if parameter error or out of memory.
484 // Similar to FPDFBitmap_Create function, with more formats and external buffer supported.
485 // Bitmap created by this function can be used in any place that a FPDF_BITMAP handle is
488 // If external scanline buffer is used, then the application should destroy the buffer
489 // by itself. FPDFBitmap_Destroy function will not destroy the buffer.
491 DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, int height, int format, void* first_scan, int stride);
493 // Function: FPDFBitmap_FillRect
494 // Fill a rectangle area in an FXDIB.
496 // bitmap - The handle to the bitmap. Returned by FPDFBitmap_Create function.
497 // left - The left side position. Starting from 0 at the left-most pixel.
498 // top - The top side position. Starting from 0 at the top-most scan line.
499 // width - Number of pixels to be filled in each scan line.
500 // height - Number of scan lines to be filled.
501 // color - A 32-bit value specifing the color, in 8888 ARGB format.
505 // This function set the color and (optionally) alpha value in specified region of the bitmap.
506 // NOTE: If alpha channel is used, this function does NOT composite the background with the source color,
507 // instead the background will be replaced by the source color and alpha.
508 // If alpha channel is not used, the "alpha" parameter is ignored.
510 DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top, int width, int height, FPDF_DWORD color);
512 // Function: FPDFBitmap_GetBuffer
513 // Get data buffer of an FXDIB
515 // bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
517 // The pointer to the first byte of the bitmap buffer.
519 // The stride may be more than width * number of bytes per pixel
520 // Applications can use this function to get the bitmap buffer pointer, then manipulate any color
521 // and/or alpha values for any pixels in the bitmap.
522 DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap);
524 // Function: FPDFBitmap_GetWidth
525 // Get width of an FXDIB.
527 // bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
529 // The number of pixels in a horizontal line of the bitmap.
530 DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap);
532 // Function: FPDFBitmap_GetHeight
533 // Get height of an FXDIB.
535 // bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
537 // The number of pixels in a vertical line of the bitmap.
538 DLLEXPORT int STDCALL FPDFBitmap_GetHeight(FPDF_BITMAP bitmap);
540 // Function: FPDFBitmap_GetStride
541 // Get number of bytes for each scan line in the bitmap buffer.
543 // bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
545 // The number of bytes for each scan line in the bitmap buffer.
547 // The stride may be more than width * number of bytes per pixel
548 DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap);
550 // Function: FPDFBitmap_Destroy
551 // Destroy an FXDIB and release all related buffers.
553 // bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
557 // This function will not destroy any external buffer.
559 DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap);
561 // Function: FPDF_VIEWERREF_GetPrintScaling
562 // Whether the PDF document prefers to be scaled or not.
564 // document - Handle to the loaded document.
568 DLLEXPORT FPDF_BOOL STDCALL FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document);
570 // Function: FPDF_VIEWERREF_GetNumCopies
571 // Returns the number of copies to be printed.
573 // document - Handle to the loaded document.
575 // The number of copies to be printed.
577 DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document);
579 // Function: FPDF_VIEWERREF_GetPrintPageRange
580 // Page numbers to initialize print dialog box when file is printed.
582 // document - Handle to the loaded document.
584 // The print page range to be used for printing.
586 DLLEXPORT FPDF_PAGERANGE STDCALL FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document);
588 // Function: FPDF_VIEWERREF_GetDuplex
589 // Returns the paper handling option to be used when printing from print dialog.
591 // document - Handle to the loaded document.
593 // The paper handling option to be used when printing.
595 DLLEXPORT FPDF_DUPLEXTYPE STDCALL FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document);
597 // Function: FPDF_CountNamedDests
598 // Get the count of named destinations in the PDF document.
600 // document - Handle to a document
602 // The count of named destinations.
603 DLLEXPORT FPDF_DWORD STDCALL FPDF_CountNamedDests(FPDF_DOCUMENT document);
605 // Function: FPDF_GetNamedDestByName
606 // get a special dest handle by the index.
608 // document - Handle to the loaded document.
609 // name - The name of a special named dest.
611 // The handle of the dest.
613 DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document, FPDF_BYTESTRING name);
615 // Function: FPDF_GetNamedDest
616 // Get the specified named destinations of the PDF document by index.
618 // document - Handle to a document
619 // index - The index of named destination.
620 // buffer - The buffer to obtain destination name, used as wchar_t*.
621 // buflen [in/out] - Size of the buffer in bytes on input, length of the result in bytes on output or -1 if the buffer is too small.
623 // The destination handle of a named destination, or NULL if no named destination corresponding to |index|.
625 // Call this function twice to get the name of the named destination:
626 // 1) First time pass in |buffer| as NULL and get buflen.
627 // 2) Second time pass in allocated |buffer| and buflen to retrieve |buffer|, which should be used as wchar_t*.
628 // If buflen is not sufficiently large, it will be set to -1 upon return.
630 DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document, int index, void* buffer, long* buflen);
636 #endif // PUBLIC_FPDFVIEW_H_