Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
fpdfview.h
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7// This is the main header file for embedders of PDFium. It provides APIs to
8// initialize the library, load documents, and render pages, amongst other
9// things.
10//
11// NOTE: None of the PDFium APIs are thread-safe. They expect to be called
12// from a single thread. Barring that, embedders are required to ensure (via
13// a mutex or similar) that only a single PDFium call can be made at a time.
14//
15// NOTE: External docs refer to this file as "fpdfview.h", so do not rename
16// despite lack of consistency with other public files.
17
18#ifndef PUBLIC_FPDFVIEW_H_
19#define PUBLIC_FPDFVIEW_H_
20
21// clang-format off
22
23#include <stddef.h>
24
25#if defined(_WIN32) && !defined(__WINDOWS__)
26#include <windows.h>
27#endif
28
29#ifdef PDF_ENABLE_XFA
30// PDF_USE_XFA is set in confirmation that this version of PDFium can support
31// XFA forms as requested by the PDF_ENABLE_XFA setting.
32#define PDF_USE_XFA
33#endif // PDF_ENABLE_XFA
34
35// PDF object types
36#define FPDF_OBJECT_UNKNOWN 0
37#define FPDF_OBJECT_BOOLEAN 1
38#define FPDF_OBJECT_NUMBER 2
39#define FPDF_OBJECT_STRING 3
40#define FPDF_OBJECT_NAME 4
41#define FPDF_OBJECT_ARRAY 5
42#define FPDF_OBJECT_DICTIONARY 6
43#define FPDF_OBJECT_STREAM 7
44#define FPDF_OBJECT_NULLOBJ 8
45#define FPDF_OBJECT_REFERENCE 9
46
47// PDF text rendering modes
48typedef enum {
49 FPDF_TEXTRENDERMODE_UNKNOWN = -1,
50 FPDF_TEXTRENDERMODE_FILL = 0,
51 FPDF_TEXTRENDERMODE_STROKE = 1,
52 FPDF_TEXTRENDERMODE_FILL_STROKE = 2,
53 FPDF_TEXTRENDERMODE_INVISIBLE = 3,
54 FPDF_TEXTRENDERMODE_FILL_CLIP = 4,
55 FPDF_TEXTRENDERMODE_STROKE_CLIP = 5,
56 FPDF_TEXTRENDERMODE_FILL_STROKE_CLIP = 6,
57 FPDF_TEXTRENDERMODE_CLIP = 7,
58 FPDF_TEXTRENDERMODE_LAST = FPDF_TEXTRENDERMODE_CLIP,
59} FPDF_TEXT_RENDERMODE;
60
61// PDF types - use incomplete types (never completed) to force API type safety.
62typedef struct fpdf_action_t__* FPDF_ACTION;
63typedef struct fpdf_annotation_t__* FPDF_ANNOTATION;
64typedef struct fpdf_attachment_t__* FPDF_ATTACHMENT;
65typedef struct fpdf_avail_t__* FPDF_AVAIL;
66typedef struct fpdf_bitmap_t__* FPDF_BITMAP;
67typedef struct fpdf_bookmark_t__* FPDF_BOOKMARK;
68typedef struct fpdf_clippath_t__* FPDF_CLIPPATH;
69typedef struct fpdf_dest_t__* FPDF_DEST;
70typedef struct fpdf_document_t__* FPDF_DOCUMENT;
71typedef struct fpdf_font_t__* FPDF_FONT;
72typedef struct fpdf_form_handle_t__* FPDF_FORMHANDLE;
73typedef const struct fpdf_glyphpath_t__* FPDF_GLYPHPATH;
74typedef struct fpdf_javascript_action_t* FPDF_JAVASCRIPT_ACTION;
75typedef struct fpdf_link_t__* FPDF_LINK;
76typedef struct fpdf_page_t__* FPDF_PAGE;
77typedef struct fpdf_pagelink_t__* FPDF_PAGELINK;
78typedef struct fpdf_pageobject_t__* FPDF_PAGEOBJECT; // (text, path, etc.)
79typedef struct fpdf_pageobjectmark_t__* FPDF_PAGEOBJECTMARK;
80typedef const struct fpdf_pagerange_t__* FPDF_PAGERANGE;
81typedef const struct fpdf_pathsegment_t* FPDF_PATHSEGMENT;
82typedef struct fpdf_schhandle_t__* FPDF_SCHHANDLE;
83typedef const struct fpdf_signature_t__* FPDF_SIGNATURE;
84typedef void* FPDF_SKIA_CANVAS; // Passed into Skia as an SkCanvas.
85typedef struct fpdf_structelement_t__* FPDF_STRUCTELEMENT;
86typedef const struct fpdf_structelement_attr_t__* FPDF_STRUCTELEMENT_ATTR;
87typedef struct fpdf_structtree_t__* FPDF_STRUCTTREE;
88typedef struct fpdf_textpage_t__* FPDF_TEXTPAGE;
89typedef struct fpdf_widget_t__* FPDF_WIDGET;
90typedef struct fpdf_xobject_t__* FPDF_XOBJECT;
91
92// Basic data types
93typedef int FPDF_BOOL;
94typedef int FPDF_RESULT;
95typedef unsigned long FPDF_DWORD;
96typedef float FS_FLOAT;
97
98// Duplex types
99typedef enum _FPDF_DUPLEXTYPE_ {
100 DuplexUndefined = 0,
101 Simplex,
102 DuplexFlipShortEdge,
103 DuplexFlipLongEdge
104} FPDF_DUPLEXTYPE;
105
106// String types
107typedef unsigned short FPDF_WCHAR;
108
109// The public PDFium API uses three types of strings: byte string, wide string
110// (UTF-16LE encoded), and platform dependent string.
111
112// Public PDFium API type for byte strings.
113typedef const char* FPDF_BYTESTRING;
114
115// The public PDFium API always uses UTF-16LE encoded wide strings, each
116// character uses 2 bytes (except surrogation), with the low byte first.
117typedef const FPDF_WCHAR* FPDF_WIDESTRING;
118
119// Structure for persisting a string beyond the duration of a callback.
120// Note: although represented as a char*, string may be interpreted as
121// a UTF-16LE formated string. Used only by XFA callbacks.
122typedef struct FPDF_BSTR_ {
123 char* str; // String buffer, manipulate only with FPDF_BStr_* methods.
124 int len; // Length of the string, in bytes.
125} FPDF_BSTR;
126
127// For Windows programmers: In most cases it's OK to treat FPDF_WIDESTRING as a
128// Windows unicode string, however, special care needs to be taken if you
129// expect to process Unicode larger than 0xffff.
130//
131// For Linux/Unix programmers: most compiler/library environments use 4 bytes
132// for a Unicode character, and you have to convert between FPDF_WIDESTRING and
133// system wide string by yourself.
134typedef const char* FPDF_STRING;
135
136// Matrix for transformation, in the form [a b c d e f], equivalent to:
137// | a b 0 |
138// | c d 0 |
139// | e f 1 |
140//
141// Translation is performed with [1 0 0 1 tx ty].
142// Scaling is performed with [sx 0 0 sy 0 0].
143// See PDF Reference 1.7, 4.2.2 Common Transformations for more.
144typedef struct _FS_MATRIX_ {
145 float a;
146 float b;
147 float c;
148 float d;
149 float e;
150 float f;
151} FS_MATRIX;
152
153// Rectangle area(float) in device or page coordinate system.
154typedef struct _FS_RECTF_ {
155 // The x-coordinate of the left-top corner.
156 float left;
157 // The y-coordinate of the left-top corner.
158 float top;
159 // The x-coordinate of the right-bottom corner.
160 float right;
161 // The y-coordinate of the right-bottom corner.
162 float bottom;
163} * FS_LPRECTF, FS_RECTF;
164
165// Const Pointer to FS_RECTF structure.
166typedef const FS_RECTF* FS_LPCRECTF;
167
168// Rectangle size. Coordinate system agnostic.
169typedef struct FS_SIZEF_ {
170 float width;
171 float height;
172} * FS_LPSIZEF, FS_SIZEF;
173
174// Const Pointer to FS_SIZEF structure.
175typedef const FS_SIZEF* FS_LPCSIZEF;
176
177// 2D Point. Coordinate system agnostic.
178typedef struct FS_POINTF_ {
179 float x;
180 float y;
181} * FS_LPPOINTF, FS_POINTF;
182
183// Const Pointer to FS_POINTF structure.
184typedef const FS_POINTF* FS_LPCPOINTF;
185
186typedef struct _FS_QUADPOINTSF {
187 FS_FLOAT x1;
188 FS_FLOAT y1;
189 FS_FLOAT x2;
190 FS_FLOAT y2;
191 FS_FLOAT x3;
192 FS_FLOAT y3;
193 FS_FLOAT x4;
194 FS_FLOAT y4;
195} FS_QUADPOINTSF;
196
197// Annotation enums.
198typedef int FPDF_ANNOTATION_SUBTYPE;
199typedef int FPDF_ANNOT_APPEARANCEMODE;
200
201// Dictionary value types.
202typedef int FPDF_OBJECT_TYPE;
203
204#if defined(COMPONENT_BUILD)
205// FPDF_EXPORT should be consistent with |export| in the pdfium_fuzzer
206// template in testing/fuzzers/BUILD.gn.
207#if defined(WIN32)
208#if defined(FPDF_IMPLEMENTATION)
209#define FPDF_EXPORT __declspec(dllexport)
210#else
211#define FPDF_EXPORT __declspec(dllimport)
212#endif // defined(FPDF_IMPLEMENTATION)
213#else
214#if defined(FPDF_IMPLEMENTATION)
215#define FPDF_EXPORT __attribute__((visibility("default")))
216#else
217#define FPDF_EXPORT
218#endif // defined(FPDF_IMPLEMENTATION)
219#endif // defined(WIN32)
220#else
221#define FPDF_EXPORT
222#endif // defined(COMPONENT_BUILD)
223
224#if defined(WIN32) && defined(FPDFSDK_EXPORTS)
225#define FPDF_CALLCONV __stdcall
226#else
227#define FPDF_CALLCONV
228#endif
229
230// Exported Functions
231#ifdef __cplusplus
232extern "C" {
233#endif
234
235// PDF renderer types - Experimental.
236// Selection of 2D graphics library to use for rendering to FPDF_BITMAPs.
237typedef enum {
238 // Anti-Grain Geometry - https://sourceforge.net/projects/agg/
239 FPDF_RENDERERTYPE_AGG = 0,
240 // Skia - https://skia.org/
241 FPDF_RENDERERTYPE_SKIA = 1,
242} FPDF_RENDERER_TYPE;
243
244// Process-wide options for initializing the library.
245typedef struct FPDF_LIBRARY_CONFIG_ {
246 // Version number of the interface. Currently must be 2.
247 // Support for version 1 will be deprecated in the future.
248 int version;
249
250 // Array of paths to scan in place of the defaults when using built-in
251 // FXGE font loading code. The array is terminated by a NULL pointer.
252 // The Array may be NULL itself to use the default paths. May be ignored
253 // entirely depending upon the platform.
254 const char** m_pUserFontPaths;
255
256 // Version 2.
257
258 // Pointer to the v8::Isolate to use, or NULL to force PDFium to create one.
259 void* m_pIsolate;
260
261 // The embedder data slot to use in the v8::Isolate to store PDFium's
262 // per-isolate data. The value needs to be in the range
263 // [0, |v8::Internals::kNumIsolateDataLots|). Note that 0 is fine for most
264 // embedders.
265 unsigned int m_v8EmbedderSlot;
266
267 // Version 3 - Experimental.
268
269 // Pointer to the V8::Platform to use.
270 void* m_pPlatform;
271
272 // Version 4 - Experimental.
273
274 // Explicit specification of core renderer to use. |m_RendererType| must be
275 // a valid value for |FPDF_LIBRARY_CONFIG| versions of this level or higher,
276 // or else the initialization will fail with an immediate crash.
277 // Note that use of a specified |FPDF_RENDERER_TYPE| value for which the
278 // corresponding render library is not included in the build will similarly
279 // fail with an immediate crash.
280 FPDF_RENDERER_TYPE m_RendererType;
281} FPDF_LIBRARY_CONFIG;
282
283// Function: FPDF_InitLibraryWithConfig
284// Initialize the PDFium library and allocate global resources for it.
285// Parameters:
286// config - configuration information as above.
287// Return value:
288// None.
289// Comments:
290// You have to call this function before you can call any PDF
291// processing functions.
293FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* config);
294
295// Function: FPDF_InitLibrary
296// Initialize the PDFium library (alternative form).
297// Parameters:
298// None
299// Return value:
300// None.
301// Comments:
302// Convenience function to call FPDF_InitLibraryWithConfig() with a
303// default configuration for backwards compatibility purposes. New
304// code should call FPDF_InitLibraryWithConfig() instead. This will
305// be deprecated in the future.
307
308// Function: FPDF_DestroyLibrary
309// Release global resources allocated to the PDFium library by
310// FPDF_InitLibrary() or FPDF_InitLibraryWithConfig().
311// Parameters:
312// None.
313// Return value:
314// None.
315// Comments:
316// After this function is called, you must not call any PDF
317// processing functions.
318//
319// Calling this function does not automatically close other
320// objects. It is recommended to close other objects before
321// closing the library with this function.
323
324// Policy for accessing the local machine time.
325#define FPDF_POLICY_MACHINETIME_ACCESS 0
326
327// Function: FPDF_SetSandBoxPolicy
328// Set the policy for the sandbox environment.
329// Parameters:
330// policy - The specified policy for setting, for example:
331// FPDF_POLICY_MACHINETIME_ACCESS.
332// enable - True to enable, false to disable the policy.
333// Return value:
334// None.
335FPDF_EXPORT void FPDF_CALLCONV FPDF_SetSandBoxPolicy(FPDF_DWORD policy,
336 FPDF_BOOL enable);
337
338#if defined(_WIN32)
339// Experimental API.
340// Function: FPDF_SetPrintMode
341// Set printing mode when printing on Windows.
342// Parameters:
343// mode - FPDF_PRINTMODE_EMF to output EMF (default)
344// FPDF_PRINTMODE_TEXTONLY to output text only (for charstream
345// devices)
346// FPDF_PRINTMODE_POSTSCRIPT2 to output level 2 PostScript into
347// EMF as a series of GDI comments.
348// FPDF_PRINTMODE_POSTSCRIPT3 to output level 3 PostScript into
349// EMF as a series of GDI comments.
350// FPDF_PRINTMODE_POSTSCRIPT2_PASSTHROUGH to output level 2
351// PostScript via ExtEscape() in PASSTHROUGH mode.
352// FPDF_PRINTMODE_POSTSCRIPT3_PASSTHROUGH to output level 3
353// PostScript via ExtEscape() in PASSTHROUGH mode.
354// FPDF_PRINTMODE_EMF_IMAGE_MASKS to output EMF, with more
355// efficient processing of documents containing image masks.
356// FPDF_PRINTMODE_POSTSCRIPT3_TYPE42 to output level 3
357// PostScript with embedded Type 42 fonts, when applicable, into
358// EMF as a series of GDI comments.
359// FPDF_PRINTMODE_POSTSCRIPT3_TYPE42_PASSTHROUGH to output level
360// 3 PostScript with embedded Type 42 fonts, when applicable,
361// via ExtEscape() in PASSTHROUGH mode.
362// Return value:
363// True if successful, false if unsuccessful (typically invalid input).
364FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_SetPrintMode(int mode);
365#endif // defined(_WIN32)
366
367// Function: FPDF_LoadDocument
368// Open and load a PDF document.
369// Parameters:
370// file_path - Path to the PDF file (including extension).
371// password - A string used as the password for the PDF file.
372// If no password is needed, empty or NULL can be used.
373// See comments below regarding the encoding.
374// Return value:
375// A handle to the loaded document, or NULL on failure.
376// Comments:
377// Loaded document can be closed by FPDF_CloseDocument().
378// If this function fails, you can use FPDF_GetLastError() to retrieve
379// the reason why it failed.
380//
381// The encoding for |file_path| is UTF-8.
382//
383// The encoding for |password| can be either UTF-8 or Latin-1. PDFs,
384// depending on the security handler revision, will only accept one or
385// the other encoding. If |password|'s encoding and the PDF's expected
386// encoding do not match, FPDF_LoadDocument() will automatically
387// convert |password| to the other encoding.
388FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV
389FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BYTESTRING password);
390
391// Function: FPDF_LoadMemDocument
392// Open and load a PDF document from memory.
393// Parameters:
394// data_buf - Pointer to a buffer containing the PDF document.
395// size - Number of bytes in the PDF document.
396// password - A string used as the password for the PDF file.
397// If no password is needed, empty or NULL can be used.
398// Return value:
399// A handle to the loaded document, or NULL on failure.
400// Comments:
401// The memory buffer must remain valid when the document is open.
402// The loaded document can be closed by FPDF_CloseDocument.
403// If this function fails, you can use FPDF_GetLastError() to retrieve
404// the reason why it failed.
405//
406// See the comments for FPDF_LoadDocument() regarding the encoding for
407// |password|.
408// Notes:
409// If PDFium is built with the XFA module, the application should call
410// FPDF_LoadXFA() function after the PDF document loaded to support XFA
411// fields defined in the fpdfformfill.h file.
412FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV
413FPDF_LoadMemDocument(const void* data_buf, int size, FPDF_BYTESTRING password);
414
415// Experimental API.
416// Function: FPDF_LoadMemDocument64
417// Open and load a PDF document from memory.
418// Parameters:
419// data_buf - Pointer to a buffer containing the PDF document.
420// size - Number of bytes in the PDF document.
421// password - A string used as the password for the PDF file.
422// If no password is needed, empty or NULL can be used.
423// Return value:
424// A handle to the loaded document, or NULL on failure.
425// Comments:
426// The memory buffer must remain valid when the document is open.
427// The loaded document can be closed by FPDF_CloseDocument.
428// If this function fails, you can use FPDF_GetLastError() to retrieve
429// the reason why it failed.
430//
431// See the comments for FPDF_LoadDocument() regarding the encoding for
432// |password|.
433// Notes:
434// If PDFium is built with the XFA module, the application should call
435// FPDF_LoadXFA() function after the PDF document loaded to support XFA
436// fields defined in the fpdfformfill.h file.
437FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV
438FPDF_LoadMemDocument64(const void* data_buf,
439 size_t size,
440 FPDF_BYTESTRING password);
441
442// Structure for custom file access.
443typedef struct {
444 // File length, in bytes.
445 unsigned long m_FileLen;
446
447 // A function pointer for getting a block of data from a specific position.
448 // Position is specified by byte offset from the beginning of the file.
449 // The pointer to the buffer is never NULL and the size is never 0.
450 // The position and size will never go out of range of the file length.
451 // It may be possible for PDFium to call this function multiple times for
452 // the same position.
453 // Return value: should be non-zero if successful, zero for error.
454 int (*m_GetBlock)(void* param,
455 unsigned long position,
456 unsigned char* pBuf,
457 unsigned long size);
458
459 // A custom pointer for all implementation specific data. This pointer will
460 // be used as the first parameter to the m_GetBlock callback.
461 void* m_Param;
462} FPDF_FILEACCESS;
463
464/*
465 * Structure for file reading or writing (I/O).
466 *
467 * Note: This is a handler and should be implemented by callers,
468 * and is only used from XFA.
469 */
470typedef struct FPDF_FILEHANDLER_ {
471 /*
472 * User-defined data.
473 * Note: Callers can use this field to track controls.
474 */
475 void* clientData;
476
477 /*
478 * Callback function to release the current file stream object.
479 *
480 * Parameters:
481 * clientData - Pointer to user-defined data.
482 * Returns:
483 * None.
484 */
485 void (*Release)(void* clientData);
486
487 /*
488 * Callback function to retrieve the current file stream size.
489 *
490 * Parameters:
491 * clientData - Pointer to user-defined data.
492 * Returns:
493 * Size of file stream.
494 */
495 FPDF_DWORD (*GetSize)(void* clientData);
496
497 /*
498 * Callback function to read data from the current file stream.
499 *
500 * Parameters:
501 * clientData - Pointer to user-defined data.
502 * offset - Offset position starts from the beginning of file
503 * stream. This parameter indicates reading position.
504 * buffer - Memory buffer to store data which are read from
505 * file stream. This parameter should not be NULL.
506 * size - Size of data which should be read from file stream,
507 * in bytes. The buffer indicated by |buffer| must be
508 * large enough to store specified data.
509 * Returns:
510 * 0 for success, other value for failure.
511 */
512 FPDF_RESULT (*ReadBlock)(void* clientData,
513 FPDF_DWORD offset,
514 void* buffer,
515 FPDF_DWORD size);
516
517 /*
518 * Callback function to write data into the current file stream.
519 *
520 * Parameters:
521 * clientData - Pointer to user-defined data.
522 * offset - Offset position starts from the beginning of file
523 * stream. This parameter indicates writing position.
524 * buffer - Memory buffer contains data which is written into
525 * file stream. This parameter should not be NULL.
526 * size - Size of data which should be written into file
527 * stream, in bytes.
528 * Returns:
529 * 0 for success, other value for failure.
530 */
531 FPDF_RESULT (*WriteBlock)(void* clientData,
532 FPDF_DWORD offset,
533 const void* buffer,
534 FPDF_DWORD size);
535 /*
536 * Callback function to flush all internal accessing buffers.
537 *
538 * Parameters:
539 * clientData - Pointer to user-defined data.
540 * Returns:
541 * 0 for success, other value for failure.
542 */
543 FPDF_RESULT (*Flush)(void* clientData);
544
545 /*
546 * Callback function to change file size.
547 *
548 * Description:
549 * This function is called under writing mode usually. Implementer
550 * can determine whether to realize it based on application requests.
551 * Parameters:
552 * clientData - Pointer to user-defined data.
553 * size - New size of file stream, in bytes.
554 * Returns:
555 * 0 for success, other value for failure.
556 */
557 FPDF_RESULT (*Truncate)(void* clientData, FPDF_DWORD size);
558} FPDF_FILEHANDLER;
559
560// Function: FPDF_LoadCustomDocument
561// Load PDF document from a custom access descriptor.
562// Parameters:
563// pFileAccess - A structure for accessing the file.
564// password - Optional password for decrypting the PDF file.
565// Return value:
566// A handle to the loaded document, or NULL on failure.
567// Comments:
568// The application must keep the file resources |pFileAccess| points to
569// valid until the returned FPDF_DOCUMENT is closed. |pFileAccess|
570// itself does not need to outlive the FPDF_DOCUMENT.
571//
572// The loaded document can be closed with FPDF_CloseDocument().
573//
574// See the comments for FPDF_LoadDocument() regarding the encoding for
575// |password|.
576// Notes:
577// If PDFium is built with the XFA module, the application should call
578// FPDF_LoadXFA() function after the PDF document loaded to support XFA
579// fields defined in the fpdfformfill.h file.
580FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV
581FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess, FPDF_BYTESTRING password);
582
583// Function: FPDF_GetFileVersion
584// Get the file version of the given PDF document.
585// Parameters:
586// doc - Handle to a document.
587// fileVersion - The PDF file version. File version: 14 for 1.4, 15
588// for 1.5, ...
589// Return value:
590// True if succeeds, false otherwise.
591// Comments:
592// If the document was created by FPDF_CreateNewDocument,
593// then this function will always fail.
594FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetFileVersion(FPDF_DOCUMENT doc,
595 int* fileVersion);
596
597#define FPDF_ERR_SUCCESS 0 // No error.
598#define FPDF_ERR_UNKNOWN 1 // Unknown error.
599#define FPDF_ERR_FILE 2 // File not found or could not be opened.
600#define FPDF_ERR_FORMAT 3 // File not in PDF format or corrupted.
601#define FPDF_ERR_PASSWORD 4 // Password required or incorrect password.
602#define FPDF_ERR_SECURITY 5 // Unsupported security scheme.
603#define FPDF_ERR_PAGE 6 // Page not found or content error.
604#ifdef PDF_ENABLE_XFA
605#define FPDF_ERR_XFALOAD 7 // Load XFA error.
606#define FPDF_ERR_XFALAYOUT 8 // Layout XFA error.
607#endif // PDF_ENABLE_XFA
608
609// Function: FPDF_GetLastError
610// Get last error code when a function fails.
611// Parameters:
612// None.
613// Return value:
614// A 32-bit integer indicating error code as defined above.
615// Comments:
616// If the previous SDK call succeeded, the return value of this
617// function is not defined. This function only works in conjunction
618// with APIs that mention FPDF_GetLastError() in their documentation.
620
621// Experimental API.
622// Function: FPDF_DocumentHasValidCrossReferenceTable
623// Whether the document's cross reference table is valid or not.
624// Parameters:
625// document - Handle to a document. Returned by FPDF_LoadDocument.
626// Return value:
627// True if the PDF parser did not encounter problems parsing the cross
628// reference table. False if the parser could not parse the cross
629// reference table and the table had to be rebuild from other data
630// within the document.
631// Comments:
632// The return value can change over time as the PDF parser evolves.
634FPDF_DocumentHasValidCrossReferenceTable(FPDF_DOCUMENT document);
635
636// Experimental API.
637// Function: FPDF_GetTrailerEnds
638// Get the byte offsets of trailer ends.
639// Parameters:
640// document - Handle to document. Returned by FPDF_LoadDocument().
641// buffer - The address of a buffer that receives the
642// byte offsets.
643// length - The size, in ints, of |buffer|.
644// Return value:
645// Returns the number of ints in the buffer on success, 0 on error.
646//
647// |buffer| is an array of integers that describes the exact byte offsets of the
648// trailer ends in the document. If |length| is less than the returned length,
649// or |document| or |buffer| is NULL, |buffer| will not be modified.
650FPDF_EXPORT unsigned long FPDF_CALLCONV
651FPDF_GetTrailerEnds(FPDF_DOCUMENT document,
652 unsigned int* buffer,
653 unsigned long length);
654
655// Function: FPDF_GetDocPermissions
656// Get file permission flags of the document.
657// Parameters:
658// document - Handle to a document. Returned by FPDF_LoadDocument.
659// Return value:
660// A 32-bit integer indicating permission flags. Please refer to the
661// PDF Reference for detailed descriptions. If the document is not
662// protected or was unlocked by the owner, 0xffffffff will be returned.
663FPDF_EXPORT unsigned long FPDF_CALLCONV
664FPDF_GetDocPermissions(FPDF_DOCUMENT document);
665
666// Function: FPDF_GetDocUserPermissions
667// Get user file permission flags of the document.
668// Parameters:
669// document - Handle to a document. Returned by FPDF_LoadDocument.
670// Return value:
671// A 32-bit integer indicating permission flags. Please refer to the
672// PDF Reference for detailed descriptions. If the document is not
673// protected, 0xffffffff will be returned. Always returns user
674// permissions, even if the document was unlocked by the owner.
675FPDF_EXPORT unsigned long FPDF_CALLCONV
676FPDF_GetDocUserPermissions(FPDF_DOCUMENT document);
677
678// Function: FPDF_GetSecurityHandlerRevision
679// Get the revision for the security handler.
680// Parameters:
681// document - Handle to a document. Returned by FPDF_LoadDocument.
682// Return value:
683// The security handler revision number. Please refer to the PDF
684// Reference for a detailed description. If the document is not
685// protected, -1 will be returned.
687FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document);
688
689// Function: FPDF_GetPageCount
690// Get total number of pages in the document.
691// Parameters:
692// document - Handle to document. Returned by FPDF_LoadDocument.
693// Return value:
694// Total number of pages in the document.
695FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageCount(FPDF_DOCUMENT document);
696
697// Function: FPDF_LoadPage
698// Load a page inside the document.
699// Parameters:
700// document - Handle to document. Returned by FPDF_LoadDocument
701// page_index - Index number of the page. 0 for the first page.
702// Return value:
703// A handle to the loaded page, or NULL if page load fails.
704// Comments:
705// The loaded page can be rendered to devices using FPDF_RenderPage.
706// The loaded page can be closed using FPDF_ClosePage.
707FPDF_EXPORT FPDF_PAGE FPDF_CALLCONV FPDF_LoadPage(FPDF_DOCUMENT document,
708 int page_index);
709
710// Experimental API
711// Function: FPDF_GetPageWidthF
712// Get page width.
713// Parameters:
714// page - Handle to the page. Returned by FPDF_LoadPage().
715// Return value:
716// Page width (excluding non-displayable area) measured in points.
717// One point is 1/72 inch (around 0.3528 mm).
718FPDF_EXPORT float FPDF_CALLCONV FPDF_GetPageWidthF(FPDF_PAGE page);
719
720// Function: FPDF_GetPageWidth
721// Get page width.
722// Parameters:
723// page - Handle to the page. Returned by FPDF_LoadPage.
724// Return value:
725// Page width (excluding non-displayable area) measured in points.
726// One point is 1/72 inch (around 0.3528 mm).
727// Note:
728// Prefer FPDF_GetPageWidthF() above. This will be deprecated in the
729// future.
730FPDF_EXPORT double FPDF_CALLCONV FPDF_GetPageWidth(FPDF_PAGE page);
731
732// Experimental API
733// Function: FPDF_GetPageHeightF
734// Get page height.
735// Parameters:
736// page - Handle to the page. Returned by FPDF_LoadPage().
737// Return value:
738// Page height (excluding non-displayable area) measured in points.
739// One point is 1/72 inch (around 0.3528 mm)
740FPDF_EXPORT float FPDF_CALLCONV FPDF_GetPageHeightF(FPDF_PAGE page);
741
742// Function: FPDF_GetPageHeight
743// Get page height.
744// Parameters:
745// page - Handle to the page. Returned by FPDF_LoadPage.
746// Return value:
747// Page height (excluding non-displayable area) measured in points.
748// One point is 1/72 inch (around 0.3528 mm)
749// Note:
750// Prefer FPDF_GetPageHeightF() above. This will be deprecated in the
751// future.
752FPDF_EXPORT double FPDF_CALLCONV FPDF_GetPageHeight(FPDF_PAGE page);
753
754// Experimental API.
755// Function: FPDF_GetPageBoundingBox
756// Get the bounding box of the page. This is the intersection between
757// its media box and its crop box.
758// Parameters:
759// page - Handle to the page. Returned by FPDF_LoadPage.
760// rect - Pointer to a rect to receive the page bounding box.
761// On an error, |rect| won't be filled.
762// Return value:
763// True for success.
764FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetPageBoundingBox(FPDF_PAGE page,
765 FS_RECTF* rect);
766
767// Experimental API.
768// Function: FPDF_GetPageSizeByIndexF
769// Get the size of the page at the given index.
770// Parameters:
771// document - Handle to document. Returned by FPDF_LoadDocument().
772// page_index - Page index, zero for the first page.
773// size - Pointer to a FS_SIZEF to receive the page size.
774// (in points).
775// Return value:
776// Non-zero for success. 0 for error (document or page not found).
778FPDF_GetPageSizeByIndexF(FPDF_DOCUMENT document,
779 int page_index,
780 FS_SIZEF* size);
781
782// Function: FPDF_GetPageSizeByIndex
783// Get the size of the page at the given index.
784// Parameters:
785// document - Handle to document. Returned by FPDF_LoadDocument.
786// page_index - Page index, zero for the first page.
787// width - Pointer to a double to receive the page width
788// (in points).
789// height - Pointer to a double to receive the page height
790// (in points).
791// Return value:
792// Non-zero for success. 0 for error (document or page not found).
793// Note:
794// Prefer FPDF_GetPageSizeByIndexF() above. This will be deprecated in
795// the future.
796FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document,
797 int page_index,
798 double* width,
799 double* height);
800
801// Page rendering flags. They can be combined with bit-wise OR.
802//
803// Set if annotations are to be rendered.
804#define FPDF_ANNOT 0x01
805// Set if using text rendering optimized for LCD display. This flag will only
806// take effect if anti-aliasing is enabled for text.
807#define FPDF_LCD_TEXT 0x02
808// Don't use the native text output available on some platforms
809#define FPDF_NO_NATIVETEXT 0x04
810// Grayscale output.
811#define FPDF_GRAYSCALE 0x08
812// Obsolete, has no effect, retained for compatibility.
813#define FPDF_DEBUG_INFO 0x80
814// Obsolete, has no effect, retained for compatibility.
815#define FPDF_NO_CATCH 0x100
816// Limit image cache size.
817#define FPDF_RENDER_LIMITEDIMAGECACHE 0x200
818// Always use halftone for image stretching.
819#define FPDF_RENDER_FORCEHALFTONE 0x400
820// Render for printing.
821#define FPDF_PRINTING 0x800
822// Set to disable anti-aliasing on text. This flag will also disable LCD
823// optimization for text rendering.
824#define FPDF_RENDER_NO_SMOOTHTEXT 0x1000
825// Set to disable anti-aliasing on images.
826#define FPDF_RENDER_NO_SMOOTHIMAGE 0x2000
827// Set to disable anti-aliasing on paths.
828#define FPDF_RENDER_NO_SMOOTHPATH 0x4000
829// Set whether to render in a reverse Byte order, this flag is only used when
830// rendering to a bitmap.
831#define FPDF_REVERSE_BYTE_ORDER 0x10
832// Set whether fill paths need to be stroked. This flag is only used when
833// FPDF_COLORSCHEME is passed in, since with a single fill color for paths the
834// boundaries of adjacent fill paths are less visible.
835#define FPDF_CONVERT_FILL_TO_STROKE 0x20
836
837// Struct for color scheme.
838// Each should be a 32-bit value specifying the color, in 8888 ARGB format.
839typedef struct FPDF_COLORSCHEME_ {
840 FPDF_DWORD path_fill_color;
841 FPDF_DWORD path_stroke_color;
842 FPDF_DWORD text_fill_color;
843 FPDF_DWORD text_stroke_color;
844} FPDF_COLORSCHEME;
845
846#ifdef _WIN32
847// Function: FPDF_RenderPage
848// Render contents of a page to a device (screen, bitmap, or printer).
849// This function is only supported on Windows.
850// Parameters:
851// dc - Handle to the device context.
852// page - Handle to the page. Returned by FPDF_LoadPage.
853// start_x - Left pixel position of the display area in
854// device coordinates.
855// start_y - Top pixel position of the display area in device
856// coordinates.
857// size_x - Horizontal size (in pixels) for displaying the page.
858// size_y - Vertical size (in pixels) for displaying the page.
859// rotate - Page orientation:
860// 0 (normal)
861// 1 (rotated 90 degrees clockwise)
862// 2 (rotated 180 degrees)
863// 3 (rotated 90 degrees counter-clockwise)
864// flags - 0 for normal display, or combination of flags
865// defined above.
866// Return value:
867// None.
868FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc,
869 FPDF_PAGE page,
870 int start_x,
871 int start_y,
872 int size_x,
873 int size_y,
874 int rotate,
875 int flags);
876#endif
877
878// Function: FPDF_RenderPageBitmap
879// Render contents of a page to a device independent bitmap.
880// Parameters:
881// bitmap - Handle to the device independent bitmap (as the
882// output buffer). The bitmap handle can be created
883// by FPDFBitmap_Create or retrieved from an image
884// object by FPDFImageObj_GetBitmap.
885// page - Handle to the page. Returned by FPDF_LoadPage
886// start_x - Left pixel position of the display area in
887// bitmap coordinates.
888// start_y - Top pixel position of the display area in bitmap
889// coordinates.
890// size_x - Horizontal size (in pixels) for displaying the page.
891// size_y - Vertical size (in pixels) for displaying the page.
892// rotate - Page orientation:
893// 0 (normal)
894// 1 (rotated 90 degrees clockwise)
895// 2 (rotated 180 degrees)
896// 3 (rotated 90 degrees counter-clockwise)
897// flags - 0 for normal display, or combination of the Page
898// Rendering flags defined above. With the FPDF_ANNOT
899// flag, it renders all annotations that do not require
900// user-interaction, which are all annotations except
901// widget and popup annotations.
902// Return value:
903// None.
904FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPageBitmap(FPDF_BITMAP bitmap,
905 FPDF_PAGE page,
906 int start_x,
907 int start_y,
908 int size_x,
909 int size_y,
910 int rotate,
911 int flags);
912
913// Function: FPDF_RenderPageBitmapWithMatrix
914// Render contents of a page to a device independent bitmap.
915// Parameters:
916// bitmap - Handle to the device independent bitmap (as the
917// output buffer). The bitmap handle can be created
918// by FPDFBitmap_Create or retrieved by
919// FPDFImageObj_GetBitmap.
920// page - Handle to the page. Returned by FPDF_LoadPage.
921// matrix - The transform matrix, which must be invertible.
922// See PDF Reference 1.7, 4.2.2 Common Transformations.
923// clipping - The rect to clip to in device coords.
924// flags - 0 for normal display, or combination of the Page
925// Rendering flags defined above. With the FPDF_ANNOT
926// flag, it renders all annotations that do not require
927// user-interaction, which are all annotations except
928// widget and popup annotations.
929// Return value:
930// None. Note that behavior is undefined if det of |matrix| is 0.
932FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap,
933 FPDF_PAGE page,
934 const FS_MATRIX* matrix,
935 const FS_RECTF* clipping,
936 int flags);
937
938#if defined(PDF_USE_SKIA)
939// Experimental API.
940// Function: FPDF_RenderPageSkia
941// Render contents of a page to a Skia SkCanvas.
942// Parameters:
943// canvas - SkCanvas to render to.
944// page - Handle to the page.
945// size_x - Horizontal size (in pixels) for displaying the page.
946// size_y - Vertical size (in pixels) for displaying the page.
947// Return value:
948// None.
949FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPageSkia(FPDF_SKIA_CANVAS canvas,
950 FPDF_PAGE page,
951 int size_x,
952 int size_y);
953#endif
954
955// Function: FPDF_ClosePage
956// Close a loaded PDF page.
957// Parameters:
958// page - Handle to the loaded page.
959// Return value:
960// None.
961FPDF_EXPORT void FPDF_CALLCONV FPDF_ClosePage(FPDF_PAGE page);
962
963// Function: FPDF_CloseDocument
964// Close a loaded PDF document.
965// Parameters:
966// document - Handle to the loaded document.
967// Return value:
968// None.
969FPDF_EXPORT void FPDF_CALLCONV FPDF_CloseDocument(FPDF_DOCUMENT document);
970
971// Function: FPDF_DeviceToPage
972// Convert the screen coordinates of a point to page coordinates.
973// Parameters:
974// page - Handle to the page. Returned by FPDF_LoadPage.
975// start_x - Left pixel position of the display area in
976// device coordinates.
977// start_y - Top pixel position of the display area in device
978// coordinates.
979// size_x - Horizontal size (in pixels) for displaying the page.
980// size_y - Vertical size (in pixels) for displaying the page.
981// rotate - Page orientation:
982// 0 (normal)
983// 1 (rotated 90 degrees clockwise)
984// 2 (rotated 180 degrees)
985// 3 (rotated 90 degrees counter-clockwise)
986// device_x - X value in device coordinates to be converted.
987// device_y - Y value in device coordinates to be converted.
988// page_x - A pointer to a double receiving the converted X
989// value in page coordinates.
990// page_y - A pointer to a double receiving the converted Y
991// value in page coordinates.
992// Return value:
993// Returns true if the conversion succeeds, and |page_x| and |page_y|
994// successfully receives the converted coordinates.
995// Comments:
996// The page coordinate system has its origin at the left-bottom corner
997// of the page, with the X-axis on the bottom going to the right, and
998// the Y-axis on the left side going up.
999//
1000// NOTE: this coordinate system can be altered when you zoom, scroll,
1001// or rotate a page, however, a point on the page should always have
1002// the same coordinate values in the page coordinate system.
1003//
1004// The device coordinate system is device dependent. For screen device,
1005// its origin is at the left-top corner of the window. However this
1006// origin can be altered by the Windows coordinate transformation
1007// utilities.
1008//
1009// You must make sure the start_x, start_y, size_x, size_y
1010// and rotate parameters have exactly same values as you used in
1011// the FPDF_RenderPage() function call.
1012FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_DeviceToPage(FPDF_PAGE page,
1013 int start_x,
1014 int start_y,
1015 int size_x,
1016 int size_y,
1017 int rotate,
1018 int device_x,
1019 int device_y,
1020 double* page_x,
1021 double* page_y);
1022
1023// Function: FPDF_PageToDevice
1024// Convert the page coordinates of a point to screen coordinates.
1025// Parameters:
1026// page - Handle to the page. Returned by FPDF_LoadPage.
1027// start_x - Left pixel position of the display area in
1028// device coordinates.
1029// start_y - Top pixel position of the display area in device
1030// coordinates.
1031// size_x - Horizontal size (in pixels) for displaying the page.
1032// size_y - Vertical size (in pixels) for displaying the page.
1033// rotate - Page orientation:
1034// 0 (normal)
1035// 1 (rotated 90 degrees clockwise)
1036// 2 (rotated 180 degrees)
1037// 3 (rotated 90 degrees counter-clockwise)
1038// page_x - X value in page coordinates.
1039// page_y - Y value in page coordinate.
1040// device_x - A pointer to an integer receiving the result X
1041// value in device coordinates.
1042// device_y - A pointer to an integer receiving the result Y
1043// value in device coordinates.
1044// Return value:
1045// Returns true if the conversion succeeds, and |device_x| and
1046// |device_y| successfully receives the converted coordinates.
1047// Comments:
1048// See comments for FPDF_DeviceToPage().
1049FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_PageToDevice(FPDF_PAGE page,
1050 int start_x,
1051 int start_y,
1052 int size_x,
1053 int size_y,
1054 int rotate,
1055 double page_x,
1056 double page_y,
1057 int* device_x,
1058 int* device_y);
1059
1060// Function: FPDFBitmap_Create
1061// Create a device independent bitmap (FXDIB).
1062// Parameters:
1063// width - The number of pixels in width for the bitmap.
1064// Must be greater than 0.
1065// height - The number of pixels in height for the bitmap.
1066// Must be greater than 0.
1067// alpha - A flag indicating whether the alpha channel is used.
1068// Non-zero for using alpha, zero for not using.
1069// Return value:
1070// The created bitmap handle, or NULL if a parameter error or out of
1071// memory.
1072// Comments:
1073// The bitmap always uses 4 bytes per pixel. The first byte is always
1074// double word aligned.
1075//
1076// The byte order is BGRx (the last byte unused if no alpha channel) or
1077// BGRA.
1078//
1079// The pixels in a horizontal line are stored side by side, with the
1080// left most pixel stored first (with lower memory address).
1081// Each line uses width * 4 bytes.
1082//
1083// Lines are stored one after another, with the top most line stored
1084// first. There is no gap between adjacent lines.
1085//
1086// This function allocates enough memory for holding all pixels in the
1087// bitmap, but it doesn't initialize the buffer. Applications can use
1088// FPDFBitmap_FillRect() to fill the bitmap using any color. If the OS
1089// allows it, this function can allocate up to 4 GB of memory.
1090FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFBitmap_Create(int width,
1091 int height,
1092 int alpha);
1093
1094// More DIB formats
1095// Unknown or unsupported format.
1096#define FPDFBitmap_Unknown 0
1097// Gray scale bitmap, one byte per pixel.
1098#define FPDFBitmap_Gray 1
1099// 3 bytes per pixel, byte order: blue, green, red.
1100#define FPDFBitmap_BGR 2
1101// 4 bytes per pixel, byte order: blue, green, red, unused.
1102#define FPDFBitmap_BGRx 3
1103// 4 bytes per pixel, byte order: blue, green, red, alpha.
1104#define FPDFBitmap_BGRA 4
1105
1106// Function: FPDFBitmap_CreateEx
1107// Create a device independent bitmap (FXDIB)
1108// Parameters:
1109// width - The number of pixels in width for the bitmap.
1110// Must be greater than 0.
1111// height - The number of pixels in height for the bitmap.
1112// Must be greater than 0.
1113// format - A number indicating for bitmap format, as defined
1114// above.
1115// first_scan - A pointer to the first byte of the first line if
1116// using an external buffer. If this parameter is NULL,
1117// then a new buffer will be created.
1118// stride - Number of bytes for each scan line. The value must
1119// be 0 or greater. When the value is 0,
1120// FPDFBitmap_CreateEx() will automatically calculate
1121// the appropriate value using |width| and |format|.
1122// When using an external buffer, it is recommended for
1123// the caller to pass in the value.
1124// When not using an external buffer, it is recommended
1125// for the caller to pass in 0.
1126// Return value:
1127// The bitmap handle, or NULL if parameter error or out of memory.
1128// Comments:
1129// Similar to FPDFBitmap_Create function, but allows for more formats
1130// and an external buffer is supported. The bitmap created by this
1131// function can be used in any place that a FPDF_BITMAP handle is
1132// required.
1133//
1134// If an external buffer is used, then the caller should destroy the
1135// buffer. FPDFBitmap_Destroy() will not destroy the buffer.
1136//
1137// It is recommended to use FPDFBitmap_GetStride() to get the stride
1138// value.
1139FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFBitmap_CreateEx(int width,
1140 int height,
1141 int format,
1142 void* first_scan,
1143 int stride);
1144
1145// Function: FPDFBitmap_GetFormat
1146// Get the format of the bitmap.
1147// Parameters:
1148// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
1149// or FPDFImageObj_GetBitmap.
1150// Return value:
1151// The format of the bitmap.
1152// Comments:
1153// Only formats supported by FPDFBitmap_CreateEx are supported by this
1154// function; see the list of such formats above.
1155FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetFormat(FPDF_BITMAP bitmap);
1156
1157// Function: FPDFBitmap_FillRect
1158// Fill a rectangle in a bitmap.
1159// Parameters:
1160// bitmap - The handle to the bitmap. Returned by
1161// FPDFBitmap_Create.
1162// left - The left position. Starting from 0 at the
1163// left-most pixel.
1164// top - The top position. Starting from 0 at the
1165// top-most line.
1166// width - Width in pixels to be filled.
1167// height - Height in pixels to be filled.
1168// color - A 32-bit value specifing the color, in 8888 ARGB
1169// format.
1170// Return value:
1171// None.
1172// Comments:
1173// This function sets the color and (optionally) alpha value in the
1174// specified region of the bitmap.
1175//
1176// NOTE: If the alpha channel is used, this function does NOT
1177// composite the background with the source color, instead the
1178// background will be replaced by the source color and the alpha.
1179//
1180// If the alpha channel is not used, the alpha parameter is ignored.
1181FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_FillRect(FPDF_BITMAP bitmap,
1182 int left,
1183 int top,
1184 int width,
1185 int height,
1186 FPDF_DWORD color);
1187
1188// Function: FPDFBitmap_GetBuffer
1189// Get data buffer of a bitmap.
1190// Parameters:
1191// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
1192// or FPDFImageObj_GetBitmap.
1193// Return value:
1194// The pointer to the first byte of the bitmap buffer.
1195// Comments:
1196// The stride may be more than width * number of bytes per pixel
1197//
1198// Applications can use this function to get the bitmap buffer pointer,
1199// then manipulate any color and/or alpha values for any pixels in the
1200// bitmap.
1201//
1202// Use FPDFBitmap_GetFormat() to find out the format of the data.
1203FPDF_EXPORT void* FPDF_CALLCONV FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap);
1204
1205// Function: FPDFBitmap_GetWidth
1206// Get width of a bitmap.
1207// Parameters:
1208// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
1209// or FPDFImageObj_GetBitmap.
1210// Return value:
1211// The width of the bitmap in pixels.
1212FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetWidth(FPDF_BITMAP bitmap);
1213
1214// Function: FPDFBitmap_GetHeight
1215// Get height of a bitmap.
1216// Parameters:
1217// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
1218// or FPDFImageObj_GetBitmap.
1219// Return value:
1220// The height of the bitmap in pixels.
1221FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetHeight(FPDF_BITMAP bitmap);
1222
1223// Function: FPDFBitmap_GetStride
1224// Get number of bytes for each line in the bitmap buffer.
1225// Parameters:
1226// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
1227// or FPDFImageObj_GetBitmap.
1228// Return value:
1229// The number of bytes for each line in the bitmap buffer.
1230// Comments:
1231// The stride may be more than width * number of bytes per pixel.
1232FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetStride(FPDF_BITMAP bitmap);
1233
1234// Function: FPDFBitmap_Destroy
1235// Destroy a bitmap and release all related buffers.
1236// Parameters:
1237// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
1238// or FPDFImageObj_GetBitmap.
1239// Return value:
1240// None.
1241// Comments:
1242// This function will not destroy any external buffers provided when
1243// the bitmap was created.
1244FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_Destroy(FPDF_BITMAP bitmap);
1245
1246// Function: FPDF_VIEWERREF_GetPrintScaling
1247// Whether the PDF document prefers to be scaled or not.
1248// Parameters:
1249// document - Handle to the loaded document.
1250// Return value:
1251// None.
1252FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
1253FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document);
1254
1255// Function: FPDF_VIEWERREF_GetNumCopies
1256// Returns the number of copies to be printed.
1257// Parameters:
1258// document - Handle to the loaded document.
1259// Return value:
1260// The number of copies to be printed.
1262FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document);
1263
1264// Function: FPDF_VIEWERREF_GetPrintPageRange
1265// Page numbers to initialize print dialog box when file is printed.
1266// Parameters:
1267// document - Handle to the loaded document.
1268// Return value:
1269// The print page range to be used for printing.
1270FPDF_EXPORT FPDF_PAGERANGE FPDF_CALLCONV
1271FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document);
1272
1273// Experimental API.
1274// Function: FPDF_VIEWERREF_GetPrintPageRangeCount
1275// Returns the number of elements in a FPDF_PAGERANGE.
1276// Parameters:
1277// pagerange - Handle to the page range.
1278// Return value:
1279// The number of elements in the page range. Returns 0 on error.
1281FPDF_VIEWERREF_GetPrintPageRangeCount(FPDF_PAGERANGE pagerange);
1282
1283// Experimental API.
1284// Function: FPDF_VIEWERREF_GetPrintPageRangeElement
1285// Returns an element from a FPDF_PAGERANGE.
1286// Parameters:
1287// pagerange - Handle to the page range.
1288// index - Index of the element.
1289// Return value:
1290// The value of the element in the page range at a given index.
1291// Returns -1 on error.
1293FPDF_VIEWERREF_GetPrintPageRangeElement(FPDF_PAGERANGE pagerange, size_t index);
1294
1295// Function: FPDF_VIEWERREF_GetDuplex
1296// Returns the paper handling option to be used when printing from
1297// the print dialog.
1298// Parameters:
1299// document - Handle to the loaded document.
1300// Return value:
1301// The paper handling option to be used when printing.
1302FPDF_EXPORT FPDF_DUPLEXTYPE FPDF_CALLCONV
1303FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document);
1304
1305// Function: FPDF_VIEWERREF_GetName
1306// Gets the contents for a viewer ref, with a given key. The value must
1307// be of type "name".
1308// Parameters:
1309// document - Handle to the loaded document.
1310// key - Name of the key in the viewer pref dictionary,
1311// encoded in UTF-8.
1312// buffer - A string to write the contents of the key to.
1313// length - Length of the buffer.
1314// Return value:
1315// The number of bytes in the contents, including the NULL terminator.
1316// Thus if the return value is 0, then that indicates an error, such
1317// as when |document| is invalid or |buffer| is NULL. If |length| is
1318// less than the returned length, or |buffer| is NULL, |buffer| will
1319// not be modified.
1320FPDF_EXPORT unsigned long FPDF_CALLCONV
1321FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document,
1322 FPDF_BYTESTRING key,
1323 char* buffer,
1324 unsigned long length);
1325
1326// Function: FPDF_CountNamedDests
1327// Get the count of named destinations in the PDF document.
1328// Parameters:
1329// document - Handle to a document
1330// Return value:
1331// The count of named destinations.
1332FPDF_EXPORT FPDF_DWORD FPDF_CALLCONV
1333FPDF_CountNamedDests(FPDF_DOCUMENT document);
1334
1335// Function: FPDF_GetNamedDestByName
1336// Get a the destination handle for the given name.
1337// Parameters:
1338// document - Handle to the loaded document.
1339// name - The name of a destination.
1340// Return value:
1341// The handle to the destination.
1342FPDF_EXPORT FPDF_DEST FPDF_CALLCONV
1343FPDF_GetNamedDestByName(FPDF_DOCUMENT document, FPDF_BYTESTRING name);
1344
1345// Function: FPDF_GetNamedDest
1346// Get the named destination by index.
1347// Parameters:
1348// document - Handle to a document
1349// index - The index of a named destination.
1350// buffer - The buffer to store the destination name,
1351// used as wchar_t*.
1352// buflen [in/out] - Size of the buffer in bytes on input,
1353// length of the result in bytes on output
1354// or -1 if the buffer is too small.
1355// Return value:
1356// The destination handle for a given index, or NULL if there is no
1357// named destination corresponding to |index|.
1358// Comments:
1359// Call this function twice to get the name of the named destination:
1360// 1) First time pass in |buffer| as NULL and get buflen.
1361// 2) Second time pass in allocated |buffer| and buflen to retrieve
1362// |buffer|, which should be used as wchar_t*.
1363//
1364// If buflen is not sufficiently large, it will be set to -1 upon
1365// return.
1366FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDF_GetNamedDest(FPDF_DOCUMENT document,
1367 int index,
1368 void* buffer,
1369 long* buflen);
1370
1371// Experimental API.
1372// Function: FPDF_GetXFAPacketCount
1373// Get the number of valid packets in the XFA entry.
1374// Parameters:
1375// document - Handle to the document.
1376// Return value:
1377// The number of valid packets, or -1 on error.
1378FPDF_EXPORT int FPDF_CALLCONV FPDF_GetXFAPacketCount(FPDF_DOCUMENT document);
1379
1380// Experimental API.
1381// Function: FPDF_GetXFAPacketName
1382// Get the name of a packet in the XFA array.
1383// Parameters:
1384// document - Handle to the document.
1385// index - Index number of the packet. 0 for the first packet.
1386// buffer - Buffer for holding the name of the XFA packet.
1387// buflen - Length of |buffer| in bytes.
1388// Return value:
1389// The length of the packet name in bytes, or 0 on error.
1390//
1391// |document| must be valid and |index| must be in the range [0, N), where N is
1392// the value returned by FPDF_GetXFAPacketCount().
1393// |buffer| is only modified if it is non-NULL and |buflen| is greater than or
1394// equal to the length of the packet name. The packet name includes a
1395// terminating NUL character. |buffer| is unmodified on error.
1397 FPDF_DOCUMENT document,
1398 int index,
1399 void* buffer,
1400 unsigned long buflen);
1401
1402// Experimental API.
1403// Function: FPDF_GetXFAPacketContent
1404// Get the content of a packet in the XFA array.
1405// Parameters:
1406// document - Handle to the document.
1407// index - Index number of the packet. 0 for the first packet.
1408// buffer - Buffer for holding the content of the XFA packet.
1409// buflen - Length of |buffer| in bytes.
1410// out_buflen - Pointer to the variable that will receive the minimum
1411// buffer size needed to contain the content of the XFA
1412// packet.
1413// Return value:
1414// Whether the operation succeeded or not.
1415//
1416// |document| must be valid and |index| must be in the range [0, N), where N is
1417// the value returned by FPDF_GetXFAPacketCount(). |out_buflen| must not be
1418// NULL. When the aforementioned arguments are valid, the operation succeeds,
1419// and |out_buflen| receives the content size. |buffer| is only modified if
1420// |buffer| is non-null and long enough to contain the content. Callers must
1421// check both the return value and the input |buflen| is no less than the
1422// returned |out_buflen| before using the data in |buffer|.
1424 FPDF_DOCUMENT document,
1425 int index,
1426 void* buffer,
1427 unsigned long buflen,
1428 unsigned long* out_buflen);
1429
1430#ifdef PDF_ENABLE_V8
1431// Function: FPDF_GetRecommendedV8Flags
1432// Returns a space-separated string of command line flags that are
1433// recommended to be passed into V8 via V8::SetFlagsFromString()
1434// prior to initializing the PDFium library.
1435// Parameters:
1436// None.
1437// Return value:
1438// NUL-terminated string of the form "--flag1 --flag2".
1439// The caller must not attempt to modify or free the result.
1440FPDF_EXPORT const char* FPDF_CALLCONV FPDF_GetRecommendedV8Flags();
1441
1442// Experimental API.
1443// Function: FPDF_GetArrayBufferAllocatorSharedInstance()
1444// Helper function for initializing V8 isolates that will
1445// use PDFium's internal memory management.
1446// Parameters:
1447// None.
1448// Return Value:
1449// Pointer to a suitable v8::ArrayBuffer::Allocator, returned
1450// as void for C compatibility.
1451// Notes:
1452// Use is optional, but allows external creation of isolates
1453// matching the ones PDFium will make when none is provided
1454// via |FPDF_LIBRARY_CONFIG::m_pIsolate|.
1455FPDF_EXPORT void* FPDF_CALLCONV FPDF_GetArrayBufferAllocatorSharedInstance();
1456#endif // PDF_ENABLE_V8
1457
1458#ifdef PDF_ENABLE_XFA
1459// Function: FPDF_BStr_Init
1460// Helper function to initialize a FPDF_BSTR.
1461FPDF_EXPORT FPDF_RESULT FPDF_CALLCONV FPDF_BStr_Init(FPDF_BSTR* bstr);
1462
1463// Function: FPDF_BStr_Set
1464// Helper function to copy string data into the FPDF_BSTR.
1465FPDF_EXPORT FPDF_RESULT FPDF_CALLCONV FPDF_BStr_Set(FPDF_BSTR* bstr,
1466 const char* cstr,
1467 int length);
1468
1469// Function: FPDF_BStr_Clear
1470// Helper function to clear a FPDF_BSTR.
1471FPDF_EXPORT FPDF_RESULT FPDF_CALLCONV FPDF_BStr_Clear(FPDF_BSTR* bstr);
1472#endif // PDF_ENABLE_XFA
1473
1474#ifdef __cplusplus
1475}
1476#endif
1477
1478#endif // PUBLIC_FPDFVIEW_H_
FX_DOWNLOADHINTS * GetDownloadHints() const
FX_FILEAVAIL * GetFileAvail() const
FPDF_FILEACCESS * GetFileAccess() const
TEST_F(CPDF_CreatorEmbedderTest, SavedDocsAreEqualAfterParse)
FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetFormControlCount(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetFontSize(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, float *value)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetRect(FPDF_ANNOTATION annot, const FS_RECTF *rect)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_RemoveAnnot(FPDF_PAGE page, int index)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetFocusableSubtypes(FPDF_FORMHANDLE hHandle, const FPDF_ANNOTATION_SUBTYPE *subtypes, size_t count)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetBorder(FPDF_ANNOTATION annot, float *horizontal_radius, float *vertical_radius, float *border_width)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot, size_t quad_index, FS_QUADPOINTSF *quad_points)
FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetFocusableSubtypesCount(FPDF_FORMHANDLE hHandle)
FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_AddInkStroke(FPDF_ANNOTATION annot, const FS_POINTF *points, size_t point_count)
FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetOptionCount(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAnnot_GetVertices(FPDF_ANNOTATION annot, FS_POINTF *buffer, unsigned long length)
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFAnnot_GetObject(FPDF_ANNOTATION annot, int index)
FPDF_EXPORT size_t FPDF_CALLCONV FPDFAnnot_CountAttachmentPoints(FPDF_ANNOTATION annot)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetFlags(FPDF_ANNOTATION annot, int flags)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAnnot_GetFormFieldName(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, FPDF_WCHAR *buffer, unsigned long buflen)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_HasKey(FPDF_ANNOTATION annot, FPDF_BYTESTRING key)
FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFAnnot_GetLinkedAnnot(FPDF_ANNOTATION annot, FPDF_BYTESTRING key)
FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_RemoveObject(FPDF_ANNOTATION annot, int index)
FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetAnnotCount(FPDF_PAGE page)
FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFPage_CreateAnnot(FPDF_PAGE page, FPDF_ANNOTATION_SUBTYPE subtype)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_IsChecked(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAnnot_GetFormFieldAlternateName(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, FPDF_WCHAR *buffer, unsigned long buflen)
FPDF_EXPORT FPDF_LINK FPDF_CALLCONV FPDFAnnot_GetLink(FPDF_ANNOTATION annot)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetAP(FPDF_ANNOTATION annot, FPDF_ANNOT_APPEARANCEMODE appearanceMode, FPDF_WIDESTRING value)
FPDF_EXPORT FPDF_ANNOTATION_SUBTYPE FPDF_CALLCONV FPDFAnnot_GetSubtype(FPDF_ANNOTATION annot)
FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV FPDFAnnot_GetValueType(FPDF_ANNOTATION annot, FPDF_BYTESTRING key)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_AppendAttachmentPoints(FPDF_ANNOTATION annot, const FS_QUADPOINTSF *quad_points)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetColor(FPDF_ANNOTATION annot, FPDFANNOT_COLORTYPE type, unsigned int *R, unsigned int *G, unsigned int *B, unsigned int *A)
FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetFormFieldFlags(FPDF_FORMHANDLE handle, FPDF_ANNOTATION annot)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetStringValue(FPDF_ANNOTATION annot, FPDF_BYTESTRING key, FPDF_WIDESTRING value)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAnnot_GetOptionLabel(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, int index, FPDF_WCHAR *buffer, unsigned long buflen)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAnnot_GetInkListPath(FPDF_ANNOTATION annot, unsigned long path_index, FS_POINTF *buffer, unsigned long length)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_IsOptionSelected(FPDF_FORMHANDLE handle, FPDF_ANNOTATION annot, int index)
FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFPage_GetAnnot(FPDF_PAGE page, int index)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAnnot_GetFormFieldExportValue(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, FPDF_WCHAR *buffer, unsigned long buflen)
FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetFlags(FPDF_ANNOTATION annot)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAnnot_GetStringValue(FPDF_ANNOTATION annot, FPDF_BYTESTRING key, FPDF_WCHAR *buffer, unsigned long buflen)
FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetFormControlIndex(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot)
FPDF_EXPORT void FPDF_CALLCONV FPDFPage_CloseAnnot(FPDF_ANNOTATION annot)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetNumberValue(FPDF_ANNOTATION annot, FPDF_BYTESTRING key, float *value)
FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetFormFieldType(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetURI(FPDF_ANNOTATION annot, const char *uri)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAnnot_GetFormFieldValue(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, FPDF_WCHAR *buffer, unsigned long buflen)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetFocusableSubtypes(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION_SUBTYPE *subtypes, size_t count)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetRect(FPDF_ANNOTATION annot, FS_RECTF *rect)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAnnot_GetAP(FPDF_ANNOTATION annot, FPDF_ANNOT_APPEARANCEMODE appearanceMode, FPDF_WCHAR *buffer, unsigned long buflen)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_IsObjectSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetLine(FPDF_ANNOTATION annot, FS_POINTF *start, FS_POINTF *end)
FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetAnnotIndex(FPDF_PAGE page, FPDF_ANNOTATION annot)
FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFAnnot_GetFormFieldAtPoint(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, const FS_POINTF *point)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAnnot_GetInkListCount(FPDF_ANNOTATION annot)
FPDFANNOT_COLORTYPE
Definition fpdf_annot.h:95
@ FPDFANNOT_COLORTYPE_InteriorColor
Definition fpdf_annot.h:97
@ FPDFANNOT_COLORTYPE_Color
Definition fpdf_annot.h:96
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetBorder(FPDF_ANNOTATION annot, float horizontal_radius, float vertical_radius, float border_width)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetColor(FPDF_ANNOTATION annot, FPDFANNOT_COLORTYPE type, unsigned int R, unsigned int G, unsigned int B, unsigned int A)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_UpdateObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_IsSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_RemoveInkList(FPDF_ANNOTATION annot)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAnnot_GetFormAdditionalActionJavaScript(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, int event, FPDF_WCHAR *buffer, unsigned long buflen)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, size_t quad_index, const FS_QUADPOINTSF *quad_points)
#define PDF_DATA_AVAIL
FPDF_EXPORT void FPDF_CALLCONV FPDFAvail_Destroy(FPDF_AVAIL avail)
FPDF_EXPORT void FPDF_CALLCONV FPDFFont_Close(FPDF_FONT font)
FPDF_EXPORT void FPDF_CALLCONV FPDFPageObj_Destroy(FPDF_PAGEOBJECT page_object)
FPDF_EXPORT void FPDF_CALLCONV FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle)
FPDF_EXPORT void FPDF_CALLCONV FPDFDoc_CloseJavaScriptAction(FPDF_JAVASCRIPT_ACTION javascript)
FPDF_EXPORT void FPDF_CALLCONV FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree)
FPDF_EXPORT void FPDF_CALLCONV FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page)
FPDF_EXPORT void FPDF_CALLCONV FPDFText_FindClose(FPDF_SCHHANDLE handle)
FPDF_EXPORT void FPDF_CALLCONV FPDFText_ClosePage(FPDF_TEXTPAGE text_page)
Definition fpdf_text.cpp:53
FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath)
FPDF_EXPORT FPDF_PAGE FPDF_CALLCONV FPDF_LoadPage(FPDF_DOCUMENT document, int page_index)
FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageCount(FPDF_DOCUMENT document)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetLastError()
FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFBitmap_CreateEx(int width, int height, int format, void *first_scan, int stride)
FPDF_EXPORT void FPDF_CALLCONV FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_DeviceToPage(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int device_x, int device_y, double *page_x, double *page_y)
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_LoadCustomDocument(FPDF_FILEACCESS *pFileAccess, FPDF_BYTESTRING password)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_PageToDevice(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, double page_x, double page_y, int *device_x, int *device_y)
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BYTESTRING password)
FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetHeight(FPDF_BITMAP bitmap)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_DocumentHasValidCrossReferenceTable(FPDF_DOCUMENT document)
FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_Destroy(FPDF_BITMAP bitmap)
FPDF_EXPORT FPDF_DUPLEXTYPE FPDF_CALLCONV FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document)
FPDF_EXPORT float FPDF_CALLCONV FPDF_GetPageHeightF(FPDF_PAGE page)
FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary()
FPDF_EXPORT int FPDF_CALLCONV FPDF_GetXFAPacketCount(FPDF_DOCUMENT document)
FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFBitmap_Create(int width, int height, int alpha)
FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetStride(FPDF_BITMAP bitmap)
FPDF_EXPORT FPDF_PAGERANGE FPDF_CALLCONV FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document)
FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_index, double *width, double *height)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetDocUserPermissions(FPDF_DOCUMENT document)
FPDF_EXPORT double FPDF_CALLCONV FPDF_GetPageWidth(FPDF_PAGE page)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetDocPermissions(FPDF_DOCUMENT document)
FPDF_EXPORT void FPDF_CALLCONV FPDF_InitLibrary()
FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDF_GetNamedDest(FPDF_DOCUMENT document, int index, void *buffer, long *buflen)
FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDF_GetNamedDestByName(FPDF_DOCUMENT document, FPDF_BYTESTRING name)
FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int flags)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetFileVersion(FPDF_DOCUMENT doc, int *fileVersion)
FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap, FPDF_PAGE page, const FS_MATRIX *matrix, const FS_RECTF *clipping, int flags)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetPageBoundingBox(FPDF_PAGE page, FS_RECTF *rect)
FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetFormat(FPDF_BITMAP bitmap)
FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top, int width, int height, FPDF_DWORD color)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document, FPDF_BYTESTRING key, char *buffer, unsigned long length)
FPDF_EXPORT void FPDF_CALLCONV FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG *config)
FPDF_EXPORT void *FPDF_CALLCONV FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap)
FPDF_EXPORT FPDF_DWORD FPDF_CALLCONV FPDF_CountNamedDests(FPDF_DOCUMENT document)
FPDF_EXPORT void FPDF_CALLCONV FPDF_CloseDocument(FPDF_DOCUMENT document)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetPageSizeByIndexF(FPDF_DOCUMENT document, int page_index, FS_SIZEF *size)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetXFAPacketContent(FPDF_DOCUMENT document, int index, void *buffer, unsigned long buflen, unsigned long *out_buflen)
FPDF_EXPORT int FPDF_CALLCONV FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetXFAPacketName(FPDF_DOCUMENT document, int index, void *buffer, unsigned long buflen)
FPDF_EXPORT double FPDF_CALLCONV FPDF_GetPageHeight(FPDF_PAGE page)
FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetWidth(FPDF_BITMAP bitmap)
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_LoadMemDocument(const void *data_buf, int size, FPDF_BYTESTRING password)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetTrailerEnds(FPDF_DOCUMENT document, unsigned int *buffer, unsigned long length)
FPDF_EXPORT float FPDF_CALLCONV FPDF_GetPageWidthF(FPDF_PAGE page)
FPDF_EXPORT void FPDF_CALLCONV FPDF_ClosePage(FPDF_PAGE page)
FPDF_EXPORT int FPDF_CALLCONV FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document)
#define FPDF_CALLCONV
Definition fpdfview.h:227
#define FPDF_EXPORT
Definition fpdfview.h:221
#define FPDF_ANNOT
Definition fpdfview.h:804
void operator()(FPDF_ANNOTATION annot)
void operator()(FPDF_AVAIL avail)
void operator()(FPDF_BITMAP bitmap)
void operator()(FPDF_CLIPPATH clip_path)
void operator()(FPDF_DOCUMENT doc)
void operator()(FPDF_FONT font)
void operator()(FPDF_FORMHANDLE form)
void operator()(FPDF_JAVASCRIPT_ACTION javascript)
void operator()(FPDF_PAGE page)
void operator()(FPDF_PAGELINK pagelink)
void operator()(FPDF_PAGEOBJECT object)
void operator()(FPDF_STRUCTTREE tree)
void operator()(FPDF_SCHHANDLE handle)
void operator()(FPDF_TEXTPAGE text)