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