blob: 55897eb467bd866deb7c717970424270119fe129 [file] [log] [blame]
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001// Copyright 2014 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Tom Sepez9857e202015-05-13 17:09:26 -07004
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07005// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
Tom Sepez1ed8a212015-05-11 15:25:39 -07007// NOTE: External docs refer to this file as "fpdfview.h", so do not rename
Dan Sinclair50cce602016-02-24 09:51:16 -05008// despite lack of consistency with other public files.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07009
Tom Sepez9857e202015-05-13 17:09:26 -070010#ifndef PUBLIC_FPDFVIEW_H_
11#define PUBLIC_FPDFVIEW_H_
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070012
13#if defined(_WIN32) && !defined(__WINDOWS__)
14#include <windows.h>
15#endif
16
Tom Sepezc46d0002015-11-30 15:46:36 -080017#ifdef PDF_ENABLE_XFA
Dan Sinclair3ebd1212016-03-09 09:59:23 -050018// PDF_USE_XFA is set in confirmation that this version of PDFium can support
19// XFA forms as requested by the PDF_ENABLE_XFA setting.
Bo Xubb5ef882014-11-06 16:13:33 -080020#define PDF_USE_XFA
Tom Sepezc46d0002015-11-30 15:46:36 -080021#endif // PDF_ENABLE_XFA
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070022
Jane Liu18ae06d2017-07-18 10:15:16 -040023// PDF object types
24#define FPDF_OBJECT_UNKNOWN 0
25#define FPDF_OBJECT_BOOLEAN 1
26#define FPDF_OBJECT_NUMBER 2
27#define FPDF_OBJECT_STRING 3
28#define FPDF_OBJECT_NAME 4
29#define FPDF_OBJECT_ARRAY 5
30#define FPDF_OBJECT_DICTIONARY 6
31#define FPDF_OBJECT_STREAM 7
32#define FPDF_OBJECT_NULLOBJ 8
33#define FPDF_OBJECT_REFERENCE 9
34
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070035// PDF types
Tom Sepez9857e202015-05-13 17:09:26 -070036typedef void* FPDF_ACTION;
Jane Liu4fd9a472017-06-01 18:56:09 -040037typedef void* FPDF_ANNOTATION;
Jane Liu18ae06d2017-07-18 10:15:16 -040038typedef void* FPDF_ATTACHMENT;
Tom Sepezc46d0002015-11-30 15:46:36 -080039typedef void* FPDF_BITMAP;
40typedef void* FPDF_BOOKMARK;
41typedef void* FPDF_CLIPPATH;
42typedef void* FPDF_DEST;
Tom Sepezc46d0002015-11-30 15:46:36 -080043typedef void* FPDF_DOCUMENT;
44typedef void* FPDF_FONT;
Tom Sepez9857e202015-05-13 17:09:26 -070045typedef void* FPDF_LINK;
Tom Sepezc46d0002015-11-30 15:46:36 -080046typedef void* FPDF_PAGE;
47typedef void* FPDF_PAGELINK;
48typedef void* FPDF_PAGEOBJECT; // Page object(text, path, etc)
Tom Sepez9857e202015-05-13 17:09:26 -070049typedef void* FPDF_PAGERANGE;
Cary Clark399be5b2016-03-14 16:51:29 -040050typedef void* FPDF_RECORDER;
Tom Sepezc46d0002015-11-30 15:46:36 -080051typedef void* FPDF_SCHHANDLE;
thestig9067fd62016-11-23 14:10:06 -080052typedef void* FPDF_STRUCTELEMENT;
53typedef void* FPDF_STRUCTTREE;
Tom Sepezc46d0002015-11-30 15:46:36 -080054typedef void* FPDF_TEXTPAGE;
55
56#ifdef PDF_ENABLE_XFA
57typedef void* FPDF_STRINGHANDLE;
58typedef void* FPDF_WIDGET;
59#endif // PDF_ENABLE_XFA
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070060
61// Basic data types
Tom Sepez9857e202015-05-13 17:09:26 -070062typedef int FPDF_BOOL;
63typedef int FPDF_ERROR;
64typedef unsigned long FPDF_DWORD;
65typedef float FS_FLOAT;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070066
Tom Sepezc46d0002015-11-30 15:46:36 -080067#ifdef PDF_ENABLE_XFA
68typedef void* FPDF_LPVOID;
69typedef void const* FPDF_LPCVOID;
70typedef char const* FPDF_LPCSTR;
71typedef int FPDF_RESULT;
72#endif
73
Bo Xu9114e832014-07-14 13:22:47 -070074// Duplex types
75typedef enum _FPDF_DUPLEXTYPE_ {
Nico Weber9d8ec5a2015-08-04 13:00:21 -070076 DuplexUndefined = 0,
77 Simplex,
78 DuplexFlipShortEdge,
79 DuplexFlipLongEdge
Bo Xu9114e832014-07-14 13:22:47 -070080} FPDF_DUPLEXTYPE;
81
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070082// String types
Tom Sepez9857e202015-05-13 17:09:26 -070083typedef unsigned short FPDF_WCHAR;
84typedef unsigned char const* FPDF_LPCBYTE;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070085
Nico Weber9d8ec5a2015-08-04 13:00:21 -070086// FPDFSDK may use three types of strings: byte string, wide string (UTF-16LE
87// encoded), and platform dependent string
Tom Sepez9857e202015-05-13 17:09:26 -070088typedef const char* FPDF_BYTESTRING;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070089
Dan Sinclair49f88b72015-10-20 15:18:51 -040090// FPDFSDK always uses UTF-16LE encoded wide strings, each character uses 2
91// bytes (except surrogation), with the low byte first.
92typedef const unsigned short* FPDF_WIDESTRING;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070093
Tom Sepezc46d0002015-11-30 15:46:36 -080094#ifdef PDF_ENABLE_XFA
Dan Sinclair49f88b72015-10-20 15:18:51 -040095// Structure for a byte string.
96// Note, a byte string commonly means a UTF-16LE formated string.
Nico Weber9d8ec5a2015-08-04 13:00:21 -070097typedef struct _FPDF_BSTR {
Dan Sinclair49f88b72015-10-20 15:18:51 -040098 // String buffer.
Nico Weber9d8ec5a2015-08-04 13:00:21 -070099 char* str;
Dan Sinclair49f88b72015-10-20 15:18:51 -0400100 // Length of the string, in bytes.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700101 int len;
Bo Xufdc00a72014-10-28 23:03:33 -0700102} FPDF_BSTR;
Tom Sepezc46d0002015-11-30 15:46:36 -0800103#endif // PDF_ENABLE_XFA
Bo Xufdc00a72014-10-28 23:03:33 -0700104
Dan Sinclair49f88b72015-10-20 15:18:51 -0400105// For Windows programmers: In most cases it's OK to treat FPDF_WIDESTRING as a
106// Windows unicode string, however, special care needs to be taken if you
107// expect to process Unicode larger than 0xffff.
108//
109// For Linux/Unix programmers: most compiler/library environments use 4 bytes
110// for a Unicode character, and you have to convert between FPDF_WIDESTRING and
111// system wide string by yourself.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700112typedef const char* FPDF_STRING;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700113
Dan Sinclair49f88b72015-10-20 15:18:51 -0400114// Matrix for transformation.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700115typedef struct _FS_MATRIX_ {
Dan Sinclair49f88b72015-10-20 15:18:51 -0400116 float a;
117 float b;
118 float c;
119 float d;
120 float e;
121 float f;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700122} FS_MATRIX;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700123
Dan Sinclair49f88b72015-10-20 15:18:51 -0400124// Rectangle area(float) in device or page coordinate system.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700125typedef struct _FS_RECTF_ {
Dan Sinclair49f88b72015-10-20 15:18:51 -0400126 // The x-coordinate of the left-top corner.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700127 float left;
Dan Sinclair49f88b72015-10-20 15:18:51 -0400128 // The y-coordinate of the left-top corner.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700129 float top;
Dan Sinclair49f88b72015-10-20 15:18:51 -0400130 // The x-coordinate of the right-bottom corner.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700131 float right;
Dan Sinclair49f88b72015-10-20 15:18:51 -0400132 // The y-coordinate of the right-bottom corner.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700133 float bottom;
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700134} * FS_LPRECTF, FS_RECTF;
Dan Sinclair49f88b72015-10-20 15:18:51 -0400135
136// Const Pointer to FS_RECTF structure.
Tom Sepez9857e202015-05-13 17:09:26 -0700137typedef const FS_RECTF* FS_LPCRECTF;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700138
Jane Liu4fd9a472017-06-01 18:56:09 -0400139// Annotation subtype.
140typedef int FPDF_ANNOTATION_SUBTYPE;
141
Jane Liu2e1a32b2017-07-06 12:01:25 -0400142// Dictionary value types.
143typedef int FPDF_OBJECT_TYPE;
144
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700145#if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
146// On Windows system, functions are exported in a DLL
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700147#define DLLEXPORT __declspec(dllexport)
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700148#define STDCALL __stdcall
149#else
150#define DLLEXPORT
151#define STDCALL
152#endif
153
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700154// Exported Functions
155#ifdef __cplusplus
156extern "C" {
157#endif
158
159// Function: FPDF_InitLibrary
Tom Sepez9857e202015-05-13 17:09:26 -0700160// Initialize the FPDFSDK library
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700161// Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -0700162// None
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700163// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700164// None.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700165// Comments:
Lei Zhang6f62d532015-09-23 15:31:44 -0700166// Convenience function to call FPDF_InitLibraryWithConfig() for
167// backwards comatibility purposes.
168DLLEXPORT void STDCALL FPDF_InitLibrary();
169
Dan Sinclair49f88b72015-10-20 15:18:51 -0400170// Process-wide options for initializing the library.
Lei Zhang6f62d532015-09-23 15:31:44 -0700171typedef struct FPDF_LIBRARY_CONFIG_ {
Tom Sepeza72e8e22015-10-07 10:17:53 -0700172 // Version number of the interface. Currently must be 2.
Lei Zhang6f62d532015-09-23 15:31:44 -0700173 int version;
174
175 // Array of paths to scan in place of the defaults when using built-in
176 // FXGE font loading code. The array is terminated by a NULL pointer.
177 // The Array may be NULL itself to use the default paths. May be ignored
178 // entirely depending upon the platform.
179 const char** m_pUserFontPaths;
Tom Sepeza72e8e22015-10-07 10:17:53 -0700180
181 // Version 2.
182
183 // pointer to the v8::Isolate to use, or NULL to force PDFium to create one.
184 void* m_pIsolate;
185
186 // The embedder data slot to use in the v8::Isolate to store PDFium's
187 // per-isolate data. The value needs to be between 0 and
188 // v8::Internals::kNumIsolateDataLots (exclusive). Note that 0 is fine
189 // for most embedders.
190 unsigned int m_v8EmbedderSlot;
Lei Zhang6f62d532015-09-23 15:31:44 -0700191} FPDF_LIBRARY_CONFIG;
192
193// Function: FPDF_InitLibraryWithConfig
194// Initialize the FPDFSDK library
195// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400196// config - configuration information as above.
Lei Zhang6f62d532015-09-23 15:31:44 -0700197// Return value:
198// None.
199// Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700200// You have to call this function before you can call any PDF
201// processing functions.
Tom Sepez326a2a72015-11-20 10:47:32 -0800202DLLEXPORT void STDCALL FPDF_InitLibraryWithConfig(
203 const FPDF_LIBRARY_CONFIG* config);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700204
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700205// Function: FPDF_DestroyLibary
Tom Sepez9857e202015-05-13 17:09:26 -0700206// Release all resources allocated by the FPDFSDK library.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700207// Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -0700208// None.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700209// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700210// None.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700211// Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700212// You can call this function to release all memory blocks allocated by
213// the library.
Dan Sinclair49f88b72015-10-20 15:18:51 -0400214// After this function is called, you should not call any PDF
215// processing functions.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700216DLLEXPORT void STDCALL FPDF_DestroyLibrary();
217
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700218// Policy for accessing the local machine time.
219#define FPDF_POLICY_MACHINETIME_ACCESS 0
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700220
221// Function: FPDF_SetSandBoxPolicy
Tom Sepez9857e202015-05-13 17:09:26 -0700222// Set the policy for the sandbox environment.
223// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400224// policy - The specified policy for setting, for example:
225// FPDF_POLICY_MACHINETIME_ACCESS.
226// enable - True to enable, false to disable the policy.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700227// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700228// None.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700229DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy,
230 FPDF_BOOL enable);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700231
rbpotterdb764702017-01-12 10:31:43 -0800232#if defined(_WIN32)
233#if defined(PDFIUM_PRINT_TEXT_WITH_GDI)
thestigfdb35ff2016-07-18 13:45:44 -0700234// Pointer to a helper function to make |font| with |text| of |text_length|
235// accessible when printing text with GDI. This is useful in sandboxed
236// environments where PDFium's access to GDI may be restricted.
237typedef void (*PDFiumEnsureTypefaceCharactersAccessible)(const LOGFONT* font,
238 const wchar_t* text,
239 size_t text_length);
240
241// Function: FPDF_SetTypefaceAccessibleFunc
242// Set the function pointer that makes GDI fonts available in sandboxed
243// environments. Experimental API.
244// Parameters:
245// func - A function pointer. See description above.
246// Return value:
247// None.
248DLLEXPORT void STDCALL
249FPDF_SetTypefaceAccessibleFunc(PDFiumEnsureTypefaceCharactersAccessible func);
250
251// Function: FPDF_SetPrintTextWithGDI
252// Set whether to use GDI to draw fonts when printing on Windows.
253// Experimental API.
254// Parameters:
255// use_gdi - Set to true to enable printing text with GDI.
256// Return value:
257// None.
258DLLEXPORT void STDCALL FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi);
rbpotterdb764702017-01-12 10:31:43 -0800259#endif // PDFIUM_PRINT_TEXT_WITH_GDI
260
rbpotter38a01b92017-07-13 11:58:01 -0700261// Function: FPDF_SetPrintPostscriptLevel
262// Set postscript printing level when printing on Windows.
263// Experimental API.
264// Parameters:
265// postscript_level- 0 to disable postscript printing,
266// 2 to print with postscript level 2,
267// 3 to print with postscript level 3.
268// All other values are invalid.
269// Return value:
270// True if successful, false if unsuccessful (typically invalid input).
271DLLEXPORT FPDF_BOOL STDCALL FPDF_SetPrintPostscriptLevel(int postscript_level);
272
rbpottere8468c42017-07-11 10:04:29 -0700273// Function: FPDF_SetPrintMode
274// Set printing mode when printing on Windows.
rbpotterdb764702017-01-12 10:31:43 -0800275// Experimental API.
276// Parameters:
rbpottere8468c42017-07-11 10:04:29 -0700277// mode - FPDF_PRINTMODE_EMF to output EMF (default)
278// FPDF_PRINTMODE_TEXTONLY to output text only (for charstream
279// devices)
280// FPDF_PRINTMODE_POSTSCRIPT2 to output level 2 postscript
281// FPDF_PRINTMODE_POSTSCRIPT3 to output level 3 postscript
rbpotterdb764702017-01-12 10:31:43 -0800282// Return value:
rbpottere8468c42017-07-11 10:04:29 -0700283// True if successful, false if unsuccessful (typically invalid input).
284DLLEXPORT FPDF_BOOL STDCALL FPDF_SetPrintMode(int mode);
rbpotterdb764702017-01-12 10:31:43 -0800285#endif // defined(_WIN32)
thestigfdb35ff2016-07-18 13:45:44 -0700286
Tom Sepez3c3201f2015-05-20 10:20:35 -0700287// Function: FPDF_LoadDocument
288// Open and load a PDF document.
289// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400290// file_path - Path to the PDF file (including extension).
291// password - A string used as the password for the PDF file.
292// If no password is needed, empty or NULL can be used.
Tom Sepez3c3201f2015-05-20 10:20:35 -0700293// Return value:
294// A handle to the loaded document, or NULL on failure.
295// Comments:
296// Loaded document can be closed by FPDF_CloseDocument().
297// If this function fails, you can use FPDF_GetLastError() to retrieve
298// the reason why it failed.
Tom Sepez9857e202015-05-13 17:09:26 -0700299DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700300 FPDF_BYTESTRING password);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700301
302// Function: FPDF_LoadMemDocument
Tom Sepez9857e202015-05-13 17:09:26 -0700303// Open and load a PDF document from memory.
304// Parameters:
305// data_buf - Pointer to a buffer containing the PDF document.
306// size - Number of bytes in the PDF document.
Dan Sinclair49f88b72015-10-20 15:18:51 -0400307// password - A string used as the password for the PDF file.
308// If no password is needed, empty or NULL can be used.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700309// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400310// A handle to the loaded document, or NULL on failure.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700311// Comments:
Tom Sepez9857e202015-05-13 17:09:26 -0700312// The memory buffer must remain valid when the document is open.
Dan Sinclair49f88b72015-10-20 15:18:51 -0400313// The loaded document can be closed by FPDF_CloseDocument.
Tom Sepez9857e202015-05-13 17:09:26 -0700314// If this function fails, you can use FPDF_GetLastError() to retrieve
Dan Sinclair49f88b72015-10-20 15:18:51 -0400315// the reason why it failed.
Bo Xufdc00a72014-10-28 23:03:33 -0700316// Notes:
Tom Sepezc46d0002015-11-30 15:46:36 -0800317// If PDFium is built with the XFA module, the application should call
318// FPDF_LoadXFA() function after the PDF document loaded to support XFA
319// fields defined in the fpdfformfill.h file.
Tom Sepez9857e202015-05-13 17:09:26 -0700320DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf,
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700321 int size,
322 FPDF_BYTESTRING password);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700323
324// Structure for custom file access.
325typedef struct {
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700326 // File length, in bytes.
327 unsigned long m_FileLen;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700328
Dan Sinclair49f88b72015-10-20 15:18:51 -0400329 // A function pointer for getting a block of data from a specific position.
330 // Position is specified by byte offset from the beginning of the file.
331 // The position and size will never go out of range of the file length.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700332 // It may be possible for FPDFSDK to call this function multiple times for
Dan Sinclair49f88b72015-10-20 15:18:51 -0400333 // the same position.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700334 // Return value: should be non-zero if successful, zero for error.
335 int (*m_GetBlock)(void* param,
336 unsigned long position,
337 unsigned char* pBuf,
338 unsigned long size);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700339
Dan Sinclair49f88b72015-10-20 15:18:51 -0400340 // A custom pointer for all implementation specific data. This pointer will
341 // be used as the first parameter to the m_GetBlock callback.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700342 void* m_Param;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700343} FPDF_FILEACCESS;
344
Tom Sepezc46d0002015-11-30 15:46:36 -0800345#ifdef PDF_ENABLE_XFA
Bo Xufdc00a72014-10-28 23:03:33 -0700346/**
347 * @brief Structure for file reading or writing (I/O).
348 *
349 * @note This is a handler and should be implemented by callers.
350 */
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700351typedef struct _FPDF_FILEHANDLER {
352 /**
353 * @brief User-defined data.
354 * @note Callers can use this field to track controls.
355 */
356 FPDF_LPVOID clientData;
357 /**
358 * @brief Callback function to release the current file stream object.
359 *
360 * @param[in] clientData Pointer to user-defined data.
361 *
362 * @return None.
363 */
364 void (*Release)(FPDF_LPVOID clientData);
365 /**
366 * @brief Callback function to retrieve the current file stream size.
367 *
368 * @param[in] clientData Pointer to user-defined data.
369 *
370 * @return Size of file stream.
371 */
372 FPDF_DWORD (*GetSize)(FPDF_LPVOID clientData);
373 /**
374 * @brief Callback function to read data from the current file stream.
375 *
376 * @param[in] clientData Pointer to user-defined data.
377 * @param[in] offset Offset position starts from the beginning of file
378 * stream. This parameter indicates reading position.
379 * @param[in] buffer Memory buffer to store data which are read from
380 * file stream. This parameter should not be <b>NULL</b>.
381 * @param[in] size Size of data which should be read from file
382 * stream, in bytes. The buffer indicated by the parameter <i>buffer</i>
383 * should be enough to store specified data.
384 *
385 * @return 0 for success, other value for failure.
386 */
Dan Sinclair3ebd1212016-03-09 09:59:23 -0500387 FPDF_RESULT (*ReadBlock)(FPDF_LPVOID clientData,
388 FPDF_DWORD offset,
389 FPDF_LPVOID buffer,
390 FPDF_DWORD size);
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700391 /**
392 * @brief Callback function to write data into the current file stream.
393 *
394 * @param[in] clientData Pointer to user-defined data.
395 * @param[in] offset Offset position starts from the beginning of file
396 * stream. This parameter indicates writing position.
397 * @param[in] buffer Memory buffer contains data which is written into
398 * file stream. This parameter should not be <b>NULL</b>.
399 * @param[in] size Size of data which should be written into file
400 * stream, in bytes.
401 *
402 * @return 0 for success, other value for failure.
403 */
Dan Sinclair3ebd1212016-03-09 09:59:23 -0500404 FPDF_RESULT (*WriteBlock)(FPDF_LPVOID clientData,
405 FPDF_DWORD offset,
406 FPDF_LPCVOID buffer,
407 FPDF_DWORD size);
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700408 /**
409 * @brief Callback function to flush all internal accessing buffers.
410 *
411 * @param[in] clientData Pointer to user-defined data.
412 *
413 * @return 0 for success, other value for failure.
414 */
415 FPDF_RESULT (*Flush)(FPDF_LPVOID clientData);
416 /**
417 * @brief Callback function to change file size.
418 *
419 * @details This function is called under writing mode usually. Implementer
420 * can determine whether to realize it based on application requests.
421 *
422 * @param[in] clientData Pointer to user-defined data.
423 * @param[in] size New size of file stream, in bytes.
424 *
425 * @return 0 for success, other value for failure.
426 */
427 FPDF_RESULT (*Truncate)(FPDF_LPVOID clientData, FPDF_DWORD size);
Bo Xufdc00a72014-10-28 23:03:33 -0700428} FPDF_FILEHANDLER, *FPDF_LPFILEHANDLER;
429
Tom Sepezc46d0002015-11-30 15:46:36 -0800430#endif
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700431// Function: FPDF_LoadCustomDocument
Tom Sepez9857e202015-05-13 17:09:26 -0700432// Load PDF document from a custom access descriptor.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700433// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400434// pFileAccess - A structure for accessing the file.
Tom Sepez9857e202015-05-13 17:09:26 -0700435// password - Optional password for decrypting the PDF file.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700436// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400437// A handle to the loaded document, or NULL on failure.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700438// Comments:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400439// The application must keep the file resources valid until the PDF
440// document is closed.
Bo Xufdc00a72014-10-28 23:03:33 -0700441//
Dan Sinclair49f88b72015-10-20 15:18:51 -0400442// The loaded document can be closed with FPDF_CloseDocument.
443// Notes:
Tom Sepezc46d0002015-11-30 15:46:36 -0800444// If PDFium is built with the XFA module, the application should call
445// FPDF_LoadXFA() function after the PDF document loaded to support XFA
446// fields defined in the fpdfformfill.h file.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700447DLLEXPORT FPDF_DOCUMENT STDCALL
448FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess, FPDF_BYTESTRING password);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700449
450// Function: FPDF_GetFileVersion
Dan Sinclair49f88b72015-10-20 15:18:51 -0400451// Get the file version of the given PDF document.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700452// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400453// doc - Handle to a document.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700454// fileVersion - The PDF file version. File version: 14 for 1.4, 15
Dan Sinclair49f88b72015-10-20 15:18:51 -0400455// for 1.5, ...
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700456// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400457// True if succeeds, false otherwise.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700458// Comments:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400459// If the document was created by FPDF_CreateNewDocument,
460// then this function will always fail.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700461DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc,
462 int* fileVersion);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700463
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700464#define FPDF_ERR_SUCCESS 0 // No error.
465#define FPDF_ERR_UNKNOWN 1 // Unknown error.
466#define FPDF_ERR_FILE 2 // File not found or could not be opened.
467#define FPDF_ERR_FORMAT 3 // File not in PDF format or corrupted.
468#define FPDF_ERR_PASSWORD 4 // Password required or incorrect password.
469#define FPDF_ERR_SECURITY 5 // Unsupported security scheme.
470#define FPDF_ERR_PAGE 6 // Page not found or content error.
Tom Sepezc46d0002015-11-30 15:46:36 -0800471#ifdef PDF_ENABLE_XFA
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700472#define FPDF_ERR_XFALOAD 7 // Load XFA error.
473#define FPDF_ERR_XFALAYOUT 8 // Layout XFA error.
Tom Sepezc46d0002015-11-30 15:46:36 -0800474#endif // PDF_ENABLE_XFA
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700475
476// Function: FPDF_GetLastError
Dan Sinclair49f88b72015-10-20 15:18:51 -0400477// Get last error code when a function fails.
Tom Sepez9857e202015-05-13 17:09:26 -0700478// Parameters:
479// None.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700480// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400481// A 32-bit integer indicating error code as defined above.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700482// Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700483// If the previous SDK call succeeded, the return value of this
Dan Sinclair49f88b72015-10-20 15:18:51 -0400484// function is not defined.
Tom Sepez9857e202015-05-13 17:09:26 -0700485DLLEXPORT unsigned long STDCALL FPDF_GetLastError();
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700486
487// Function: FPDF_GetDocPermission
Tom Sepez9857e202015-05-13 17:09:26 -0700488// Get file permission flags of the document.
489// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400490// document - Handle to a document. Returned by FPDF_LoadDocument.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700491// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400492// A 32-bit integer indicating permission flags. Please refer to the
493// PDF Reference for detailed descriptions. If the document is not
494// protected, 0xffffffff will be returned.
Tom Sepez9857e202015-05-13 17:09:26 -0700495DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700496
Bo Xuc5cab022014-09-19 19:16:31 -0700497// Function: FPDF_GetSecurityHandlerRevision
Dan Sinclair49f88b72015-10-20 15:18:51 -0400498// Get the revision for the security handler.
Bo Xuc5cab022014-09-19 19:16:31 -0700499// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400500// document - Handle to a document. Returned by FPDF_LoadDocument.
Bo Xuc5cab022014-09-19 19:16:31 -0700501// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400502// The security handler revision number. Please refer to the PDF
503// Reference for a detailed description. If the document is not
504// protected, -1 will be returned.
Bo Xuc5cab022014-09-19 19:16:31 -0700505DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document);
506
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700507// Function: FPDF_GetPageCount
Dan Sinclair49f88b72015-10-20 15:18:51 -0400508// Get total number of pages in the document.
Tom Sepez9857e202015-05-13 17:09:26 -0700509// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400510// document - Handle to document. Returned by FPDF_LoadDocument.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700511// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700512// Total number of pages in the document.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700513DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document);
514
515// Function: FPDF_LoadPage
Dan Sinclair49f88b72015-10-20 15:18:51 -0400516// Load a page inside the document.
Tom Sepez9857e202015-05-13 17:09:26 -0700517// Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700518// document - Handle to document. Returned by FPDF_LoadDocument
Tom Sepez9857e202015-05-13 17:09:26 -0700519// page_index - Index number of the page. 0 for the first page.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700520// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400521// A handle to the loaded page, or NULL if page load fails.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700522// Comments:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400523// The loaded page can be rendered to devices using FPDF_RenderPage.
524// The loaded page can be closed using FPDF_ClosePage.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700525DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document,
526 int page_index);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700527
528// Function: FPDF_GetPageWidth
Tom Sepez9857e202015-05-13 17:09:26 -0700529// Get page width.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700530// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400531// page - Handle to the page. Returned by FPDF_LoadPage.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700532// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700533// Page width (excluding non-displayable area) measured in points.
534// One point is 1/72 inch (around 0.3528 mm).
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700535DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page);
536
537// Function: FPDF_GetPageHeight
Tom Sepez9857e202015-05-13 17:09:26 -0700538// Get page height.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700539// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400540// page - Handle to the page. Returned by FPDF_LoadPage.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700541// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700542// Page height (excluding non-displayable area) measured in points.
543// One point is 1/72 inch (around 0.3528 mm)
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700544DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page);
545
546// Function: FPDF_GetPageSizeByIndex
Dan Sinclair49f88b72015-10-20 15:18:51 -0400547// Get the size of the page at the given index.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700548// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400549// document - Handle to document. Returned by FPDF_LoadDocument.
Tom Sepez9857e202015-05-13 17:09:26 -0700550// page_index - Page index, zero for the first page.
Dan Sinclair49f88b72015-10-20 15:18:51 -0400551// width - Pointer to a double to receive the page width
552// (in points).
553// height - Pointer to a double to receive the page height
554// (in points).
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700555// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700556// Non-zero for success. 0 for error (document or page not found).
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700557DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document,
558 int page_index,
559 double* width,
560 double* height);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700561
Dan Sinclair49f88b72015-10-20 15:18:51 -0400562// Page rendering flags. They can be combined with bit-wise OR.
563//
564// Set if annotations are to be rendered.
565#define FPDF_ANNOT 0x01
566// Set if using text rendering optimized for LCD display.
567#define FPDF_LCD_TEXT 0x02
568// Don't use the native text output available on some platforms
569#define FPDF_NO_NATIVETEXT 0x04
570// Grayscale output.
571#define FPDF_GRAYSCALE 0x08
572// Set if you want to get some debug info.
573#define FPDF_DEBUG_INFO 0x80
574// Set if you don't want to catch exceptions.
575#define FPDF_NO_CATCH 0x100
576// Limit image cache size.
577#define FPDF_RENDER_LIMITEDIMAGECACHE 0x200
578// Always use halftone for image stretching.
579#define FPDF_RENDER_FORCEHALFTONE 0x400
580// Render for printing.
581#define FPDF_PRINTING 0x800
582// Set to disable anti-aliasing on text.
583#define FPDF_RENDER_NO_SMOOTHTEXT 0x1000
584// Set to disable anti-aliasing on images.
585#define FPDF_RENDER_NO_SMOOTHIMAGE 0x2000
586// Set to disable anti-aliasing on paths.
587#define FPDF_RENDER_NO_SMOOTHPATH 0x4000
588// Set whether to render in a reverse Byte order, this flag is only used when
589// rendering to a bitmap.
590#define FPDF_REVERSE_BYTE_ORDER 0x10
591
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700592#ifdef _WIN32
593// Function: FPDF_RenderPage
Dan Sinclair49f88b72015-10-20 15:18:51 -0400594// Render contents of a page to a device (screen, bitmap, or printer).
595// This function is only supported on Windows.
Tom Sepez9857e202015-05-13 17:09:26 -0700596// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400597// dc - Handle to the device context.
598// page - Handle to the page. Returned by FPDF_LoadPage.
599// start_x - Left pixel position of the display area in
600// device coordinates.
601// start_y - Top pixel position of the display area in device
602// coordinates.
Tom Sepez9857e202015-05-13 17:09:26 -0700603// size_x - Horizontal size (in pixels) for displaying the page.
604// size_y - Vertical size (in pixels) for displaying the page.
Dan Sinclair49f88b72015-10-20 15:18:51 -0400605// rotate - Page orientation:
606// 0 (normal)
607// 1 (rotated 90 degrees clockwise)
608// 2 (rotated 180 degrees)
609// 3 (rotated 90 degrees counter-clockwise)
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700610// flags - 0 for normal display, or combination of flags
Dan Sinclair49f88b72015-10-20 15:18:51 -0400611// defined above.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700612// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700613// None.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700614DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc,
615 FPDF_PAGE page,
616 int start_x,
617 int start_y,
618 int size_x,
619 int size_y,
620 int rotate,
621 int flags);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700622#endif
623
624// Function: FPDF_RenderPageBitmap
Dan Sinclair49f88b72015-10-20 15:18:51 -0400625// Render contents of a page to a device independent bitmap.
Tom Sepez9857e202015-05-13 17:09:26 -0700626// Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700627// bitmap - Handle to the device independent bitmap (as the
Dan Sinclair49f88b72015-10-20 15:18:51 -0400628// output buffer). The bitmap handle can be created
629// by FPDFBitmap_Create.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700630// page - Handle to the page. Returned by FPDF_LoadPage
Dan Sinclair49f88b72015-10-20 15:18:51 -0400631// start_x - Left pixel position of the display area in
632// bitmap coordinates.
633// start_y - Top pixel position of the display area in bitmap
634// coordinates.
Tom Sepez9857e202015-05-13 17:09:26 -0700635// size_x - Horizontal size (in pixels) for displaying the page.
636// size_y - Vertical size (in pixels) for displaying the page.
Dan Sinclair49f88b72015-10-20 15:18:51 -0400637// rotate - Page orientation:
638// 0 (normal)
639// 1 (rotated 90 degrees clockwise)
640// 2 (rotated 180 degrees)
641// 3 (rotated 90 degrees counter-clockwise)
thestiga78ba602016-11-23 15:25:48 -0800642// flags - 0 for normal display, or combination of the Page
643// Rendering flags defined above. With the FPDF_ANNOT
644// flag, it renders all annotations that do not require
645// user-interaction, which are all annotations except
646// widget and popup annotations.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700647// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700648// None.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700649DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap,
650 FPDF_PAGE page,
651 int start_x,
652 int start_y,
653 int size_x,
654 int size_y,
655 int rotate,
656 int flags);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700657
thestiga78ba602016-11-23 15:25:48 -0800658// Function: FPDF_RenderPageBitmapWithMatrix
659// Render contents of a page to a device independent bitmap.
660// Parameters:
661// bitmap - Handle to the device independent bitmap (as the
662// output buffer). The bitmap handle can be created
663// by FPDFBitmap_Create.
664// page - Handle to the page. Returned by FPDF_LoadPage
665// matrix - The transform matrix.
666// clipping - The rect to clip to.
667// flags - 0 for normal display, or combination of the Page
668// Rendering flags defined above. With the FPDF_ANNOT
669// flag, it renders all annotations that do not require
670// user-interaction, which are all annotations except
671// widget and popup annotations.
672// Return value:
673// None.
674DLLEXPORT void STDCALL FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap,
675 FPDF_PAGE page,
676 const FS_MATRIX* matrix,
677 const FS_RECTF* clipping,
678 int flags);
679
Cary Clark399be5b2016-03-14 16:51:29 -0400680#ifdef _SKIA_SUPPORT_
681DLLEXPORT FPDF_RECORDER STDCALL FPDF_RenderPageSkp(FPDF_PAGE page,
682 int size_x,
683 int size_y);
684#endif
685
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700686// Function: FPDF_ClosePage
Tom Sepez9857e202015-05-13 17:09:26 -0700687// Close a loaded PDF page.
688// Parameters:
689// page - Handle to the loaded page.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700690// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700691// None.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700692DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page);
693
694// Function: FPDF_CloseDocument
Tom Sepez9857e202015-05-13 17:09:26 -0700695// Close a loaded PDF document.
696// Parameters:
697// document - Handle to the loaded document.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700698// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700699// None.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700700DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document);
701
702// Function: FPDF_DeviceToPage
Dan Sinclair49f88b72015-10-20 15:18:51 -0400703// Convert the screen coordinates of a point to page coordinates.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700704// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400705// page - Handle to the page. Returned by FPDF_LoadPage.
706// start_x - Left pixel position of the display area in
707// device coordinates.
708// start_y - Top pixel position of the display area in device
709// coordinates.
Tom Sepez9857e202015-05-13 17:09:26 -0700710// size_x - Horizontal size (in pixels) for displaying the page.
711// size_y - Vertical size (in pixels) for displaying the page.
Dan Sinclair49f88b72015-10-20 15:18:51 -0400712// rotate - Page orientation:
713// 0 (normal)
714// 1 (rotated 90 degrees clockwise)
715// 2 (rotated 180 degrees)
716// 3 (rotated 90 degrees counter-clockwise)
717// device_x - X value in device coordinates to be converted.
718// device_y - Y value in device coordinates to be converted.
719// page_x - A pointer to a double receiving the converted X
720// value in page coordinates.
721// page_y - A pointer to a double receiving the converted Y
722// value in page coordinates.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700723// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700724// None.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700725// Comments:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400726// The page coordinate system has its origin at the left-bottom corner
727// of the page, with the X-axis on the bottom going to the right, and
728// the Y-axis on the left side going up.
729//
730// NOTE: this coordinate system can be altered when you zoom, scroll,
731// or rotate a page, however, a point on the page should always have
Tom Sepez9857e202015-05-13 17:09:26 -0700732// the same coordinate values in the page coordinate system.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700733//
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700734// The device coordinate system is device dependent. For screen device,
Dan Sinclair49f88b72015-10-20 15:18:51 -0400735// its origin is at the left-top corner of the window. However this
736// origin can be altered by the Windows coordinate transformation
737// utilities.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700738//
Dan Sinclair49f88b72015-10-20 15:18:51 -0400739// You must make sure the start_x, start_y, size_x, size_y
740// and rotate parameters have exactly same values as you used in
741// the FPDF_RenderPage() function call.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700742DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page,
743 int start_x,
744 int start_y,
745 int size_x,
746 int size_y,
747 int rotate,
748 int device_x,
749 int device_y,
750 double* page_x,
751 double* page_y);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700752
753// Function: FPDF_PageToDevice
Dan Sinclair49f88b72015-10-20 15:18:51 -0400754// Convert the page coordinates of a point to screen coordinates.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700755// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400756// page - Handle to the page. Returned by FPDF_LoadPage.
757// start_x - Left pixel position of the display area in
758// device coordinates.
759// start_y - Top pixel position of the display area in device
760// coordinates.
Tom Sepez9857e202015-05-13 17:09:26 -0700761// size_x - Horizontal size (in pixels) for displaying the page.
762// size_y - Vertical size (in pixels) for displaying the page.
Dan Sinclair49f88b72015-10-20 15:18:51 -0400763// rotate - Page orientation:
764// 0 (normal)
765// 1 (rotated 90 degrees clockwise)
766// 2 (rotated 180 degrees)
767// 3 (rotated 90 degrees counter-clockwise)
768// page_x - X value in page coordinates.
769// page_y - Y value in page coordinate.
770// device_x - A pointer to an integer receiving the result X
771// value in device coordinates.
772// device_y - A pointer to an integer receiving the result Y
773// value in device coordinates.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700774// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700775// None.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700776// Comments:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400777// See comments for FPDF_DeviceToPage().
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700778DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page,
779 int start_x,
780 int start_y,
781 int size_x,
782 int size_y,
783 int rotate,
784 double page_x,
785 double page_y,
786 int* device_x,
787 int* device_y);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700788
789// Function: FPDFBitmap_Create
Dan Sinclair49f88b72015-10-20 15:18:51 -0400790// Create a device independent bitmap (FXDIB).
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700791// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400792// width - The number of pixels in width for the bitmap.
793// Must be greater than 0.
794// height - The number of pixels in height for the bitmap.
795// Must be greater than 0.
796// alpha - A flag indicating whether the alpha channel is used.
797// Non-zero for using alpha, zero for not using.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700798// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400799// The created bitmap handle, or NULL if a parameter error or out of
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700800// memory.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700801// Comments:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400802// The bitmap always uses 4 bytes per pixel. The first byte is always
803// double word aligned.
804//
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700805// The byte order is BGRx (the last byte unused if no alpha channel) or
806// BGRA.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700807//
Dan Sinclair49f88b72015-10-20 15:18:51 -0400808// The pixels in a horizontal line are stored side by side, with the
809// left most pixel stored first (with lower memory address).
810// Each line uses width * 4 bytes.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700811//
Dan Sinclair49f88b72015-10-20 15:18:51 -0400812// Lines are stored one after another, with the top most line stored
813// first. There is no gap between adjacent lines.
Tom Sepez9857e202015-05-13 17:09:26 -0700814//
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700815// This function allocates enough memory for holding all pixels in the
Dan Sinclair49f88b72015-10-20 15:18:51 -0400816// bitmap, but it doesn't initialize the buffer. Applications can use
817// FPDFBitmap_FillRect to fill the bitmap using any color.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700818DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width,
819 int height,
820 int alpha);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700821
822// More DIB formats
Dan Sinclair49f88b72015-10-20 15:18:51 -0400823// Gray scale bitmap, one byte per pixel.
824#define FPDFBitmap_Gray 1
825// 3 bytes per pixel, byte order: blue, green, red.
826#define FPDFBitmap_BGR 2
827// 4 bytes per pixel, byte order: blue, green, red, unused.
828#define FPDFBitmap_BGRx 3
829// 4 bytes per pixel, byte order: blue, green, red, alpha.
830#define FPDFBitmap_BGRA 4
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700831
832// Function: FPDFBitmap_CreateEx
Dan Sinclair49f88b72015-10-20 15:18:51 -0400833// Create a device independent bitmap (FXDIB)
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700834// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400835// width - The number of pixels in width for the bitmap.
836// Must be greater than 0.
837// height - The number of pixels in height for the bitmap.
838// Must be greater than 0.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700839// format - A number indicating for bitmap format, as defined
Dan Sinclair49f88b72015-10-20 15:18:51 -0400840// above.
841// first_scan - A pointer to the first byte of the first line if
842// using an external buffer. If this parameter is NULL,
843// then the a new buffer will be created.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700844// stride - Number of bytes for each scan line, for external
Dan Sinclair49f88b72015-10-20 15:18:51 -0400845// buffer only.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700846// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400847// The bitmap handle, or NULL if parameter error or out of memory.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700848// Comments:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400849// Similar to FPDFBitmap_Create function, but allows for more formats
850// and an external buffer is supported. The bitmap created by this
851// function can be used in any place that a FPDF_BITMAP handle is
Tom Sepez9857e202015-05-13 17:09:26 -0700852// required.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700853//
Dan Sinclair49f88b72015-10-20 15:18:51 -0400854// If an external buffer is used, then the application should destroy
855// the buffer by itself. FPDFBitmap_Destroy function will not destroy
856// the buffer.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700857DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width,
858 int height,
859 int format,
860 void* first_scan,
861 int stride);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700862
863// Function: FPDFBitmap_FillRect
Dan Sinclair49f88b72015-10-20 15:18:51 -0400864// Fill a rectangle in a bitmap.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700865// Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700866// bitmap - The handle to the bitmap. Returned by
Dan Sinclair49f88b72015-10-20 15:18:51 -0400867// FPDFBitmap_Create.
868// left - The left position. Starting from 0 at the
869// left-most pixel.
870// top - The top position. Starting from 0 at the
871// top-most line.
872// width - Width in pixels to be filled.
873// height - Height in pixels to be filled.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700874// color - A 32-bit value specifing the color, in 8888 ARGB
Dan Sinclair49f88b72015-10-20 15:18:51 -0400875// format.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700876// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700877// None.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700878// Comments:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400879// This function sets the color and (optionally) alpha value in the
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700880// specified region of the bitmap.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700881//
Dan Sinclair49f88b72015-10-20 15:18:51 -0400882// NOTE: If the alpha channel is used, this function does NOT
883// composite the background with the source color, instead the
884// background will be replaced by the source color and the alpha.
885//
886// If the alpha channel is not used, the alpha parameter is ignored.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700887DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap,
888 int left,
889 int top,
890 int width,
891 int height,
892 FPDF_DWORD color);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700893
894// Function: FPDFBitmap_GetBuffer
Dan Sinclair49f88b72015-10-20 15:18:51 -0400895// Get data buffer of a bitmap.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700896// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400897// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700898// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700899// The pointer to the first byte of the bitmap buffer.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700900// Comments:
Tom Sepez9857e202015-05-13 17:09:26 -0700901// The stride may be more than width * number of bytes per pixel
Dan Sinclair49f88b72015-10-20 15:18:51 -0400902//
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700903// Applications can use this function to get the bitmap buffer pointer,
Dan Sinclair49f88b72015-10-20 15:18:51 -0400904// then manipulate any color and/or alpha values for any pixels in the
905// bitmap.
906//
907// The data is in BGRA format. Where the A maybe unused if alpha was
908// not specified.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700909DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap);
910
911// Function: FPDFBitmap_GetWidth
Dan Sinclair49f88b72015-10-20 15:18:51 -0400912// Get width of a bitmap.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700913// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400914// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700915// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400916// The width of the bitmap in pixels.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700917DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap);
918
919// Function: FPDFBitmap_GetHeight
Dan Sinclair49f88b72015-10-20 15:18:51 -0400920// Get height of a bitmap.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700921// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400922// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700923// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400924// The height of the bitmap in pixels.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700925DLLEXPORT int STDCALL FPDFBitmap_GetHeight(FPDF_BITMAP bitmap);
926
927// Function: FPDFBitmap_GetStride
Dan Sinclair49f88b72015-10-20 15:18:51 -0400928// Get number of bytes for each line in the bitmap buffer.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700929// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400930// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700931// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400932// The number of bytes for each line in the bitmap buffer.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700933// Comments:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400934// The stride may be more than width * number of bytes per pixel.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700935DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap);
936
937// Function: FPDFBitmap_Destroy
Dan Sinclair49f88b72015-10-20 15:18:51 -0400938// Destroy a bitmap and release all related buffers.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700939// Parameters:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400940// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700941// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700942// None.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700943// Comments:
Dan Sinclair49f88b72015-10-20 15:18:51 -0400944// This function will not destroy any external buffers provided when
945// the bitmap was created.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700946DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap);
947
948// Function: FPDF_VIEWERREF_GetPrintScaling
Tom Sepez9857e202015-05-13 17:09:26 -0700949// Whether the PDF document prefers to be scaled or not.
950// Parameters:
951// document - Handle to the loaded document.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700952// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700953// None.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700954DLLEXPORT FPDF_BOOL STDCALL
955FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700956
Bo Xu9114e832014-07-14 13:22:47 -0700957// Function: FPDF_VIEWERREF_GetNumCopies
Tom Sepez9857e202015-05-13 17:09:26 -0700958// Returns the number of copies to be printed.
Bo Xu9114e832014-07-14 13:22:47 -0700959// Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -0700960// document - Handle to the loaded document.
Bo Xu9114e832014-07-14 13:22:47 -0700961// Return value:
962// The number of copies to be printed.
Bo Xu9114e832014-07-14 13:22:47 -0700963DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document);
964
965// Function: FPDF_VIEWERREF_GetPrintPageRange
Tom Sepez9857e202015-05-13 17:09:26 -0700966// Page numbers to initialize print dialog box when file is printed.
Bo Xu9114e832014-07-14 13:22:47 -0700967// Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -0700968// document - Handle to the loaded document.
Bo Xu9114e832014-07-14 13:22:47 -0700969// Return value:
970// The print page range to be used for printing.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700971DLLEXPORT FPDF_PAGERANGE STDCALL
972FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document);
Bo Xu9114e832014-07-14 13:22:47 -0700973
974// Function: FPDF_VIEWERREF_GetDuplex
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700975// Returns the paper handling option to be used when printing from
Dan Sinclair49f88b72015-10-20 15:18:51 -0400976// the print dialog.
Bo Xu9114e832014-07-14 13:22:47 -0700977// Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -0700978// document - Handle to the loaded document.
Bo Xu9114e832014-07-14 13:22:47 -0700979// Return value:
980// The paper handling option to be used when printing.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700981DLLEXPORT FPDF_DUPLEXTYPE STDCALL
982FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document);
Bo Xu9114e832014-07-14 13:22:47 -0700983
thestig04bebfe2016-11-04 16:07:25 -0700984// Function: FPDF_VIEWERREF_GetName
985// Gets the contents for a viewer ref, with a given key. The value must
986// be of type "name".
987// Parameters:
988// document - Handle to the loaded document.
989// key - Name of the key in the viewer pref dictionary.
990// buffer - A string to write the contents of the key to.
991// length - Length of the buffer.
992// Return value:
993// The number of bytes in the contents, including the NULL terminator.
994// Thus if the return value is 0, then that indicates an error, such
995// as when |document| is invalid or |buffer| is NULL. If |length| is
996// less than the returned length, or |buffer| is NULL, |buffer| will
997// not be modified.
998DLLEXPORT unsigned long STDCALL FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document,
999 FPDF_BYTESTRING key,
1000 char* buffer,
1001 unsigned long length);
1002
Bo Xu4d62b6b2015-01-10 22:52:59 -08001003// Function: FPDF_CountNamedDests
Tom Sepez9857e202015-05-13 17:09:26 -07001004// Get the count of named destinations in the PDF document.
Bo Xu4d62b6b2015-01-10 22:52:59 -08001005// Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -07001006// document - Handle to a document
Bo Xu4d62b6b2015-01-10 22:52:59 -08001007// Return value:
Tom Sepez9857e202015-05-13 17:09:26 -07001008// The count of named destinations.
Bo Xu4d62b6b2015-01-10 22:52:59 -08001009DLLEXPORT FPDF_DWORD STDCALL FPDF_CountNamedDests(FPDF_DOCUMENT document);
1010
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001011// Function: FPDF_GetNamedDestByName
Dan Sinclair49f88b72015-10-20 15:18:51 -04001012// Get a the destination handle for the given name.
Tom Sepez9857e202015-05-13 17:09:26 -07001013// Parameters:
1014// document - Handle to the loaded document.
Dan Sinclair49f88b72015-10-20 15:18:51 -04001015// name - The name of a destination.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001016// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -04001017// The handle to the destination.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001018DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,
1019 FPDF_BYTESTRING name);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001020
Bo Xu4d62b6b2015-01-10 22:52:59 -08001021// Function: FPDF_GetNamedDest
Dan Sinclair49f88b72015-10-20 15:18:51 -04001022// Get the named destination by index.
Bo Xu4d62b6b2015-01-10 22:52:59 -08001023// Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -07001024// document - Handle to a document
Dan Sinclair49f88b72015-10-20 15:18:51 -04001025// index - The index of a named destination.
1026// buffer - The buffer to store the destination name,
1027// used as wchar_t*.
1028// buflen [in/out] - Size of the buffer in bytes on input,
1029// length of the result in bytes on output
1030// or -1 if the buffer is too small.
Bo Xu4d62b6b2015-01-10 22:52:59 -08001031// Return value:
Dan Sinclair49f88b72015-10-20 15:18:51 -04001032// The destination handle for a given index, or NULL if there is no
1033// named destination corresponding to |index|.
Bo Xu4d62b6b2015-01-10 22:52:59 -08001034// Comments:
Tom Sepez9857e202015-05-13 17:09:26 -07001035// Call this function twice to get the name of the named destination:
Dan Sinclair49f88b72015-10-20 15:18:51 -04001036// 1) First time pass in |buffer| as NULL and get buflen.
1037// 2) Second time pass in allocated |buffer| and buflen to retrieve
1038// |buffer|, which should be used as wchar_t*.
Bo Xu4d62b6b2015-01-10 22:52:59 -08001039//
Dan Sinclair49f88b72015-10-20 15:18:51 -04001040// If buflen is not sufficiently large, it will be set to -1 upon
1041// return.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001042DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document,
1043 int index,
1044 void* buffer,
1045 long* buflen);
Bo Xu4d62b6b2015-01-10 22:52:59 -08001046
Tom Sepezc46d0002015-11-30 15:46:36 -08001047#ifdef PDF_ENABLE_XFA
Tom Sepez9857e202015-05-13 17:09:26 -07001048// Function: FPDF_BStr_Init
1049// Helper function to initialize a byte string.
Bo Xufdc00a72014-10-28 23:03:33 -07001050DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Init(FPDF_BSTR* str);
1051
Tom Sepez9857e202015-05-13 17:09:26 -07001052// Function: FPDF_BStr_Set
1053// Helper function to set string data.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001054DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Set(FPDF_BSTR* str,
1055 FPDF_LPCSTR bstr,
1056 int length);
Bo Xufdc00a72014-10-28 23:03:33 -07001057
Tom Sepez9857e202015-05-13 17:09:26 -07001058// Function: FPDF_BStr_Clear
1059// Helper function to clear a byte string.
Bo Xufdc00a72014-10-28 23:03:33 -07001060DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Clear(FPDF_BSTR* str);
Tom Sepezc46d0002015-11-30 15:46:36 -08001061#endif // PDF_ENABLE_XFA
Bo Xufdc00a72014-10-28 23:03:33 -07001062
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001063#ifdef __cplusplus
Tom Sepez9857e202015-05-13 17:09:26 -07001064}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001065#endif
1066
Tom Sepez9857e202015-05-13 17:09:26 -07001067#endif // PUBLIC_FPDFVIEW_H_