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
58 // encoded), and platform dependent string
59 typedef const char* FPDF_BYTESTRING;
61 typedef const unsigned short*
62 FPDF_WIDESTRING; // Foxit PDF SDK always use UTF-16LE encoding wide string,
63 // each character use 2 bytes (except surrogation), with low byte first.
65 // For Windows programmers: for most case it's OK to treat FPDF_WIDESTRING as
66 // Windows unicode string,
67 // however, special care needs to be taken if you expect to process
68 // Unicode larger than 0xffff.
69 // For Linux/Unix programmers: most compiler/library environment uses 4 bytes
70 // for a Unicode character,
71 // you have to convert between FPDF_WIDESTRING and system wide string by
75 typedef const unsigned short* FPDF_STRING;
77 typedef const char* FPDF_STRING;
80 /** @brief Matrix for transformation. */
81 typedef struct _FS_MATRIX_ {
82 float a; /**< @brief Coefficient a.*/
83 float b; /**< @brief Coefficient b.*/
84 float c; /**< @brief Coefficient c.*/
85 float d; /**< @brief Coefficient d.*/
86 float e; /**< @brief Coefficient e.*/
87 float f; /**< @brief Coefficient f.*/
90 /** @brief Rectangle area(float) in device or page coordination system. */
91 typedef struct _FS_RECTF_ {
93 /** @brief The x-coordinate of the left-top corner. */
95 /** @brief The y-coordinate of the left-top corner. */
97 /** @brief The x-coordinate of the right-bottom corner. */
99 /** @brief The y-coordinate of the right-bottom corner. */
102 } * FS_LPRECTF, FS_RECTF;
103 /** @brief Const Pointer to ::FS_RECTF structure.*/
104 typedef const FS_RECTF* FS_LPCRECTF;
106 #if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
107 // On Windows system, functions are exported in a DLL
108 #define DLLEXPORT __declspec(dllexport)
109 #define STDCALL __stdcall
115 // Exported Functions
120 // Function: FPDF_InitLibrary
121 // Initialize the FPDFSDK library
127 // You have to call this function before you can call any PDF
128 // processing functions.
129 DLLEXPORT void STDCALL FPDF_InitLibrary();
131 // Function: FPDF_DestroyLibary
132 // Release all resources allocated by the FPDFSDK library.
138 // You can call this function to release all memory blocks allocated by
140 // After this function called, you should not call any PDF processing
142 DLLEXPORT void STDCALL FPDF_DestroyLibrary();
144 // Policy for accessing the local machine time.
145 #define FPDF_POLICY_MACHINETIME_ACCESS 0
147 // Function: FPDF_SetSandBoxPolicy
148 // Set the policy for the sandbox environment.
150 // policy - The specified policy for setting, for
151 // example:FPDF_POLICY_MACHINETIME_ACCESS.
152 // enable - True for enable, False for disable the policy.
155 DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy,
158 // Function: FPDF_LoadDocument
159 // Open and load a PDF document.
161 // file_path [in] - Path to the PDF file (including extension).
162 // password [in] - A string used as the password for PDF file.
163 // If no password needed, empty or NULL can be used.
165 // A handle to the loaded document, or NULL on failure.
167 // Loaded document can be closed by FPDF_CloseDocument().
168 // If this function fails, you can use FPDF_GetLastError() to retrieve
169 // the reason why it failed.
170 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
171 FPDF_BYTESTRING password);
173 // Function: FPDF_LoadMemDocument
174 // Open and load a PDF document from memory.
176 // data_buf - Pointer to a buffer containing the PDF document.
177 // size - Number of bytes in the PDF document.
178 // password - A string used as the password for PDF file.
179 // If no password needed, empty or NULL can be used.
181 // A handle to the loaded document. If failed, NULL is returned.
183 // The memory buffer must remain valid when the document is open.
184 // Loaded document can be closed by FPDF_CloseDocument.
185 // If this function fails, you can use FPDF_GetLastError() to retrieve
186 // the reason why it fails.
188 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf,
190 FPDF_BYTESTRING password);
192 // Structure for custom file access.
194 // File length, in bytes.
195 unsigned long m_FileLen;
197 // A function pointer for getting a block of data from specific position.
198 // Position is specified by byte offset from beginning of the file.
199 // The position and size will never go out range of file length.
200 // It may be possible for FPDFSDK to call this function multiple times for
202 // Return value: should be non-zero if successful, zero for error.
203 int (*m_GetBlock)(void* param,
204 unsigned long position,
208 // A custom pointer for all implementation specific data.
209 // This pointer will be used as the first parameter to m_GetBlock callback.
213 // Function: FPDF_LoadCustomDocument
214 // Load PDF document from a custom access descriptor.
216 // pFileAccess - A structure for access the file.
217 // password - Optional password for decrypting the PDF file.
219 // A handle to the loaded document. If failed, NULL is returned.
221 // The application should maintain the file resources being valid until
222 // the PDF document close.
223 // Loaded document can be closed by FPDF_CloseDocument.
224 DLLEXPORT FPDF_DOCUMENT STDCALL
225 FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess, FPDF_BYTESTRING password);
227 // Function: FPDF_GetFileVersion
228 // Get the file version of the specific PDF document.
230 // doc - Handle to document.
231 // fileVersion - The PDF file version. File version: 14 for 1.4, 15
234 // TRUE if this call succeed, If failed, FALSE is returned.
236 // If the document is created by function ::FPDF_CreateNewDocument,
237 // then this function would always fail.
238 DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc,
241 #define FPDF_ERR_SUCCESS 0 // No error.
242 #define FPDF_ERR_UNKNOWN 1 // Unknown error.
243 #define FPDF_ERR_FILE 2 // File not found or could not be opened.
244 #define FPDF_ERR_FORMAT 3 // File not in PDF format or corrupted.
245 #define FPDF_ERR_PASSWORD 4 // Password required or incorrect password.
246 #define FPDF_ERR_SECURITY 5 // Unsupported security scheme.
247 #define FPDF_ERR_PAGE 6 // Page not found or content error.
249 // Function: FPDF_GetLastError
250 // Get last error code when an SDK function failed.
254 // A 32-bit integer indicating error codes (defined above).
256 // If the previous SDK call succeeded, the return value of this
260 DLLEXPORT unsigned long STDCALL FPDF_GetLastError();
262 // Function: FPDF_GetDocPermission
263 // Get file permission flags of the document.
265 // document - Handle to document. Returned by FPDF_LoadDocument
268 // A 32-bit integer indicating permission flags. Please refer to PDF
270 // detailed description. If the document is not protected, 0xffffffff
273 DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document);
275 // Function: FPDF_GetSecurityHandlerRevision
276 // Get the revision for security handler.
278 // document - Handle to document. Returned by FPDF_LoadDocument
281 // The security handler revision number. Please refer to PDF Reference
283 // detailed description. If the document is not protected, -1 will be
286 DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document);
288 // Function: FPDF_GetPageCount
289 // Get total number of pages in a document.
291 // document - Handle to document. Returned by FPDF_LoadDocument
294 // Total number of pages in the document.
296 DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document);
298 // Function: FPDF_LoadPage
299 // Load a page inside a document.
301 // document - Handle to document. Returned by FPDF_LoadDocument
303 // page_index - Index number of the page. 0 for the first page.
305 // A handle to the loaded page. If failed, NULL is returned.
307 // Loaded page can be rendered to devices using FPDF_RenderPage
309 // Loaded page can be closed by FPDF_ClosePage.
311 DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document,
314 // Function: FPDF_GetPageWidth
317 // page - Handle to the page. Returned by FPDF_LoadPage
320 // Page width (excluding non-displayable area) measured in points.
321 // One point is 1/72 inch (around 0.3528 mm).
323 DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page);
325 // Function: FPDF_GetPageHeight
328 // page - Handle to the page. Returned by FPDF_LoadPage
331 // Page height (excluding non-displayable area) measured in points.
332 // One point is 1/72 inch (around 0.3528 mm)
334 DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page);
336 // Function: FPDF_GetPageSizeByIndex
337 // Get the size of a page by index.
339 // document - Handle to document. Returned by FPDF_LoadDocument
341 // page_index - Page index, zero for the first page.
342 // width - Pointer to a double value receiving the page width
344 // height - Pointer to a double value receiving the page height
347 // Non-zero for success. 0 for error (document or page not found).
349 DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document,
354 // Page rendering flags. They can be combined with bit OR.
355 #define FPDF_ANNOT 0x01 // Set if annotations are to be rendered.
356 #define FPDF_LCD_TEXT \
357 0x02 // Set if using text rendering optimized for LCD display.
358 #define FPDF_NO_NATIVETEXT \
359 0x04 // Don't use the native text output available on some platforms
360 #define FPDF_GRAYSCALE 0x08 // Grayscale output.
361 #define FPDF_DEBUG_INFO 0x80 // Set if you want to get some debug info.
362 // Please discuss with Foxit first if you need to collect debug info.
363 #define FPDF_NO_CATCH 0x100 // Set if you don't want to catch exception.
364 #define FPDF_RENDER_LIMITEDIMAGECACHE 0x200 // Limit image cache size.
365 #define FPDF_RENDER_FORCEHALFTONE \
366 0x400 // Always use halftone for image stretching.
367 #define FPDF_PRINTING 0x800 // Render for printing.
368 #define FPDF_RENDER_NO_SMOOTHTEXT \
369 0x1000 // Set to disable anti-aliasing on text.
370 #define FPDF_RENDER_NO_SMOOTHIMAGE \
371 0x2000 // Set to disable anti-aliasing on images.
372 #define FPDF_RENDER_NO_SMOOTHPATH \
373 0x4000 // Set to disable anti-aliasing on paths.
374 #define FPDF_REVERSE_BYTE_ORDER \
375 0x10 // set whether render in a reverse Byte order, this flag only
376 // enable when render to a bitmap.
378 // Function: FPDF_RenderPage
379 // Render contents in a page to a device (screen, bitmap, or printer).
380 // This function is only supported on Windows system.
382 // dc - Handle to device context.
383 // page - Handle to the page. Returned by FPDF_LoadPage
385 // start_x - Left pixel position of the display area in the
386 // device coordinate.
387 // start_y - Top pixel position of the display area in the device
389 // size_x - Horizontal size (in pixels) for displaying the page.
390 // size_y - Vertical size (in pixels) for displaying the page.
391 // rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees
393 // 2 (rotated 180 degrees), 3 (rotated 90 degrees
394 // counter-clockwise).
395 // flags - 0 for normal display, or combination of flags
400 DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc,
410 // Function: FPDF_RenderPageBitmap
411 // Render contents in a page to a device independent bitmap
413 // bitmap - Handle to the device independent bitmap (as the
415 // Bitmap handle can be created by FPDFBitmap_Create
417 // page - Handle to the page. Returned by FPDF_LoadPage
419 // start_x - Left pixel position of the display area in the
420 // bitmap coordinate.
421 // start_y - Top pixel position of the display area in the bitmap
423 // size_x - Horizontal size (in pixels) for displaying the page.
424 // size_y - Vertical size (in pixels) for displaying the page.
425 // rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees
427 // 2 (rotated 180 degrees), 3 (rotated 90 degrees
428 // counter-clockwise).
429 // flags - 0 for normal display, or combination of flags
434 DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap,
443 // Function: FPDF_ClosePage
444 // Close a loaded PDF page.
446 // page - Handle to the loaded page.
450 DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page);
452 // Function: FPDF_CloseDocument
453 // Close a loaded PDF document.
455 // document - Handle to the loaded document.
459 DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document);
461 // Function: FPDF_DeviceToPage
462 // Convert the screen coordinate of a point to page coordinate.
464 // page - Handle to the page. Returned by FPDF_LoadPage
466 // start_x - Left pixel position of the display area in the
467 // device coordinate.
468 // start_y - Top pixel position of the display area in the device
470 // size_x - Horizontal size (in pixels) for displaying the page.
471 // size_y - Vertical size (in pixels) for displaying the page.
472 // rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees
474 // 2 (rotated 180 degrees), 3 (rotated 90 degrees
475 // counter-clockwise).
476 // device_x - X value in device coordinate, for the point to be
478 // device_y - Y value in device coordinate, for the point to be
480 // page_x - A Pointer to a double receiving the converted X
481 // value in page coordinate.
482 // page_y - A Pointer to a double receiving the converted Y
483 // value in page coordinate.
487 // The page coordinate system has its origin at left-bottom corner of
488 // the page, with X axis goes along
489 // the bottom side to the right, and Y axis goes along the left side
490 // upward. NOTE: this coordinate system
491 // can be altered when you zoom, scroll, or rotate a page, however, a
492 // point on the page should always have
493 // the same coordinate values in the page coordinate system.
495 // The device coordinate system is device dependent. For screen device,
496 // its origin is at left-top
497 // corner of the window. However this origin can be altered by Windows
498 // coordinate transformation
499 // utilities. You must make sure the start_x, start_y, size_x, size_y
500 // and rotate parameters have exactly
501 // same values as you used in FPDF_RenderPage() function call.
503 DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page,
514 // Function: FPDF_PageToDevice
515 // Convert the page coordinate of a point to screen coordinate.
517 // page - Handle to the page. Returned by FPDF_LoadPage
519 // start_x - Left pixel position of the display area in the
520 // device coordinate.
521 // start_y - Top pixel position of the display area in the device
523 // size_x - Horizontal size (in pixels) for displaying the page.
524 // size_y - Vertical size (in pixels) for displaying the page.
525 // rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees
527 // 2 (rotated 180 degrees), 3 (rotated 90 degrees
528 // counter-clockwise).
529 // page_x - X value in page coordinate, for the point to be
531 // page_y - Y value in page coordinate, for the point to be
533 // device_x - A pointer to an integer receiving the result X value
534 // in device coordinate.
535 // device_y - A pointer to an integer receiving the result Y value
536 // in device coordinate.
540 // See comments of FPDF_DeviceToPage() function.
542 DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page,
553 // Function: FPDFBitmap_Create
554 // Create a Foxit Device Independent Bitmap (FXDIB).
556 // width - Number of pixels in a horizontal line of the bitmap.
557 // Must be greater than 0.
558 // height - Number of pixels in a vertical line of the bitmap.
559 // Must be greater than 0.
560 // alpha - A flag indicating whether alpha channel is used.
561 // Non-zero for using alpha, zero for not using.
563 // The created bitmap handle, or NULL if parameter error or out of
566 // An FXDIB always use 4 byte per pixel. The first byte of a pixel is
567 // always double word aligned.
568 // Each pixel contains red (R), green (G), blue (B) and optionally
570 // The byte order is BGRx (the last byte unused if no alpha channel) or
573 // The pixels in a horizontal line (also called scan line) are stored
574 // side by side, with left most
575 // pixel stored first (with lower memory address). Each scan line uses
578 // Scan lines are stored one after another, with top most scan line
579 // stored first. There is no gap
580 // between adjacent scan lines.
582 // This function allocates enough memory for holding all pixels in the
583 // bitmap, but it doesn't
584 // initialize the buffer. Applications can use FPDFBitmap_FillRect to
585 // fill the bitmap using any color.
586 DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width,
591 #define FPDFBitmap_Gray 1 // Gray scale bitmap, one byte per pixel.
592 #define FPDFBitmap_BGR 2 // 3 bytes per pixel, byte order: blue, green, red.
593 #define FPDFBitmap_BGRx \
594 3 // 4 bytes per pixel, byte order: blue, green, red, unused.
595 #define FPDFBitmap_BGRA \
596 4 // 4 bytes per pixel, byte order: blue, green, red, alpha.
598 // Function: FPDFBitmap_CreateEx
599 // Create a Foxit Device Independent Bitmap (FXDIB)
601 // width - Number of pixels in a horizontal line of the bitmap.
602 // Must be greater than 0.
603 // height - Number of pixels in a vertical line of the bitmap.
604 // Must be greater than 0.
605 // format - A number indicating for bitmap format, as defined
607 // first_scan - A pointer to the first byte of first scan line, for
609 // only. If this parameter is NULL, then the SDK will
610 // create its own buffer.
611 // stride - Number of bytes for each scan line, for external
614 // The created bitmap handle, or NULL if parameter error or out of
617 // Similar to FPDFBitmap_Create function, with more formats and
618 // external buffer supported.
619 // Bitmap created by this function can be used in any place that a
620 // FPDF_BITMAP handle is
623 // If external scanline buffer is used, then the application should
624 // destroy the buffer
625 // by itself. FPDFBitmap_Destroy function will not destroy the buffer.
627 DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width,
633 // Function: FPDFBitmap_FillRect
634 // Fill a rectangle area in an FXDIB.
636 // bitmap - The handle to the bitmap. Returned by
637 // FPDFBitmap_Create function.
638 // left - The left side position. Starting from 0 at the
640 // top - The top side position. Starting from 0 at the
641 // top-most scan line.
642 // width - Number of pixels to be filled in each scan line.
643 // height - Number of scan lines to be filled.
644 // color - A 32-bit value specifing the color, in 8888 ARGB
649 // This function set the color and (optionally) alpha value in
650 // specified region of the bitmap.
651 // NOTE: If alpha channel is used, this function does NOT composite the
652 // background with the source color,
653 // instead the background will be replaced by the source color and
655 // If alpha channel is not used, the "alpha" parameter is ignored.
657 DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap,
664 // Function: FPDFBitmap_GetBuffer
665 // Get data buffer of an FXDIB
667 // bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
670 // The pointer to the first byte of the bitmap buffer.
672 // The stride may be more than width * number of bytes per pixel
673 // Applications can use this function to get the bitmap buffer pointer,
674 // then manipulate any color
675 // and/or alpha values for any pixels in the bitmap.
676 DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap);
678 // Function: FPDFBitmap_GetWidth
679 // Get width of an FXDIB.
681 // bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
684 // The number of pixels in a horizontal line of the bitmap.
685 DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap);
687 // Function: FPDFBitmap_GetHeight
688 // Get height of an FXDIB.
690 // bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
693 // The number of pixels in a vertical line of the bitmap.
694 DLLEXPORT int STDCALL FPDFBitmap_GetHeight(FPDF_BITMAP bitmap);
696 // Function: FPDFBitmap_GetStride
697 // Get number of bytes for each scan line in the bitmap buffer.
699 // bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
702 // The number of bytes for each scan line in the bitmap buffer.
704 // The stride may be more than width * number of bytes per pixel
705 DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap);
707 // Function: FPDFBitmap_Destroy
708 // Destroy an FXDIB and release all related buffers.
710 // bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
715 // This function will not destroy any external buffer.
717 DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap);
719 // Function: FPDF_VIEWERREF_GetPrintScaling
720 // Whether the PDF document prefers to be scaled or not.
722 // document - Handle to the loaded document.
726 DLLEXPORT FPDF_BOOL STDCALL
727 FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document);
729 // Function: FPDF_VIEWERREF_GetNumCopies
730 // Returns the number of copies to be printed.
732 // document - Handle to the loaded document.
734 // The number of copies to be printed.
736 DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document);
738 // Function: FPDF_VIEWERREF_GetPrintPageRange
739 // Page numbers to initialize print dialog box when file is printed.
741 // document - Handle to the loaded document.
743 // The print page range to be used for printing.
745 DLLEXPORT FPDF_PAGERANGE STDCALL
746 FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document);
748 // Function: FPDF_VIEWERREF_GetDuplex
749 // Returns the paper handling option to be used when printing from
752 // document - Handle to the loaded document.
754 // The paper handling option to be used when printing.
756 DLLEXPORT FPDF_DUPLEXTYPE STDCALL
757 FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document);
759 // Function: FPDF_CountNamedDests
760 // Get the count of named destinations in the PDF document.
762 // document - Handle to a document
764 // The count of named destinations.
765 DLLEXPORT FPDF_DWORD STDCALL FPDF_CountNamedDests(FPDF_DOCUMENT document);
767 // Function: FPDF_GetNamedDestByName
768 // get a special dest handle by the index.
770 // document - Handle to the loaded document.
771 // name - The name of a special named dest.
773 // The handle of the dest.
775 DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,
776 FPDF_BYTESTRING name);
778 // Function: FPDF_GetNamedDest
779 // Get the specified named destinations of the PDF document by index.
781 // document - Handle to a document
782 // index - The index of named destination.
783 // buffer - The buffer to obtain destination name, used as
785 // buflen [in/out] - Size of the buffer in bytes on input, length of
786 // the result in bytes on output or -1 if the buffer is too small.
788 // The destination handle of a named destination, or NULL if no named
789 // destination corresponding to |index|.
791 // Call this function twice to get the name of the named destination:
792 // 1) First time pass in |buffer| as NULL and get buflen.
793 // 2) Second time pass in allocated |buffer| and buflen to retrieve
794 // |buffer|, which should be used as wchar_t*.
795 // If buflen is not sufficiently large, it will be set to -1 upon
798 DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document,
807 #endif // PUBLIC_FPDFVIEW_H_