| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 // NOTE: External docs refer to this file as "fpdfview.h", so do not rename | 7 // NOTE: External docs refer to this file as "fpdfview.h", so do not rename |
| 8 // despite lack of consitency with other public files. | 8 // despite lack of consitency with other public files. |
| 9 | 9 |
| 10 #ifndef PUBLIC_FPDFVIEW_H_ | 10 #ifndef PUBLIC_FPDFVIEW_H_ |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // however, special care needs to be taken if you expect to process Unicod
e larger than 0xffff. | 93 // however, special care needs to be taken if you expect to process Unicod
e larger than 0xffff. |
| 94 // For Linux/Unix programmers: most compiler/library environment uses 4 bytes fo
r a Unicode character, | 94 // For Linux/Unix programmers: most compiler/library environment uses 4 bytes fo
r a Unicode character, |
| 95 // you have to convert between FPDF_WIDESTRING and system wide string by yo
urself. | 95 // you have to convert between FPDF_WIDESTRING and system wide string by yo
urself. |
| 96 | 96 |
| 97 #ifdef _WIN32_WCE | 97 #ifdef _WIN32_WCE |
| 98 typedef const unsigned short* FPDF_STRING; | 98 typedef const unsigned short* FPDF_STRING; |
| 99 #else | 99 #else |
| 100 typedef const char* FPDF_STRING; | 100 typedef const char* FPDF_STRING; |
| 101 #endif | 101 #endif |
| 102 | 102 |
| 103 #ifndef _FS_DEF_MATRIX_ | |
| 104 #define _FS_DEF_MATRIX_ | |
| 105 /** @brief Matrix for transformation. */ | 103 /** @brief Matrix for transformation. */ |
| 106 typedef struct _FS_MATRIX_ | 104 typedef struct _FS_MATRIX_ |
| 107 { | 105 { |
| 108 float a; /**< @brief Coefficient a.*/ | 106 float a; /**< @brief Coefficient a.*/ |
| 109 float b; /**< @brief Coefficient b.*/ | 107 float b; /**< @brief Coefficient b.*/ |
| 110 float c; /**< @brief Coefficient c.*/ | 108 float c; /**< @brief Coefficient c.*/ |
| 111 float d; /**< @brief Coefficient d.*/ | 109 float d; /**< @brief Coefficient d.*/ |
| 112 float e; /**< @brief Coefficient e.*/ | 110 float e; /**< @brief Coefficient e.*/ |
| 113 float f; /**< @brief Coefficient f.*/ | 111 float f; /**< @brief Coefficient f.*/ |
| 114 } FS_MATRIX; | 112 } FS_MATRIX; |
| 115 #endif | |
| 116 | 113 |
| 117 #ifndef _FS_DEF_RECTF_ | |
| 118 #define _FS_DEF_RECTF_ | |
| 119 /** @brief Rectangle area(float) in device or page coordination system. */ | 114 /** @brief Rectangle area(float) in device or page coordination system. */ |
| 120 typedef struct _FS_RECTF_ | 115 typedef struct _FS_RECTF_ |
| 121 { | 116 { |
| 122 /**@{*/ | 117 /**@{*/ |
| 123 /** @brief The x-coordinate of the left-top corner. */ | 118 /** @brief The x-coordinate of the left-top corner. */ |
| 124 float left; | 119 float left; |
| 125 /** @brief The y-coordinate of the left-top corner. */ | 120 /** @brief The y-coordinate of the left-top corner. */ |
| 126 float top; | 121 float top; |
| 127 /** @brief The x-coordinate of the right-bottom corner. */ | 122 /** @brief The x-coordinate of the right-bottom corner. */ |
| 128 float right; | 123 float right; |
| 129 /** @brief The y-coordinate of the right-bottom corner. */ | 124 /** @brief The y-coordinate of the right-bottom corner. */ |
| 130 float bottom; | 125 float bottom; |
| 131 /**@}*/ | 126 /**@}*/ |
| 132 }* FS_LPRECTF, FS_RECTF; | 127 }* FS_LPRECTF, FS_RECTF; |
| 133 /** @brief Const Pointer to ::FS_RECTF structure.*/ | 128 /** @brief Const Pointer to ::FS_RECTF structure.*/ |
| 134 typedef const FS_RECTF* FS_LPCRECTF; | 129 typedef const FS_RECTF* FS_LPCRECTF; |
| 135 #endif | |
| 136 | 130 |
| 137 #if defined(_WIN32) && defined(FPDFSDK_EXPORTS) | 131 #if defined(_WIN32) && defined(FPDFSDK_EXPORTS) |
| 138 // On Windows system, functions are exported in a DLL | 132 // On Windows system, functions are exported in a DLL |
| 139 #define DLLEXPORT __declspec( dllexport ) | 133 #define DLLEXPORT __declspec( dllexport ) |
| 140 #define STDCALL __stdcall | 134 #define STDCALL __stdcall |
| 141 #else | 135 #else |
| 142 #define DLLEXPORT | 136 #define DLLEXPORT |
| 143 #define STDCALL | 137 #define STDCALL |
| 144 #endif | 138 #endif |
| 145 | 139 |
| 146 extern const char g_ExpireDate[]; | |
| 147 extern const char g_ModuleCodes[]; | |
| 148 | |
| 149 // Exported Functions | 140 // Exported Functions |
| 150 #ifdef __cplusplus | 141 #ifdef __cplusplus |
| 151 extern "C" { | 142 extern "C" { |
| 152 #endif | 143 #endif |
| 153 | 144 |
| 154 // Function: FPDF_InitLibrary | 145 // Function: FPDF_InitLibrary |
| 155 // Initialize the FPDFSDK library | 146 // Initialize the FPDFSDK library |
| 156 // Parameters: | 147 // Parameters: |
| 157 // None | 148 // None |
| 158 // Return value: | 149 // Return value: |
| 159 // None. | 150 // None. |
| 160 // Comments: | 151 // Comments: |
| 161 // You have to call this function before you can call any PDF processin
g functions. | 152 // You have to call this function before you can call any PDF processin
g functions. |
| 162 | |
| 163 DLLEXPORT void STDCALL FPDF_InitLibrary(); | 153 DLLEXPORT void STDCALL FPDF_InitLibrary(); |
| 164 | 154 |
| 165 | |
| 166 // Function: FPDF_DestroyLibary | 155 // Function: FPDF_DestroyLibary |
| 167 // Release all resources allocated by the FPDFSDK library. | 156 // Release all resources allocated by the FPDFSDK library. |
| 168 // Parameters: | 157 // Parameters: |
| 169 // None. | 158 // None. |
| 170 // Return value: | 159 // Return value: |
| 171 // None. | 160 // None. |
| 172 // Comments: | 161 // Comments: |
| 173 // You can call this function to release all memory blocks allocated by
the library. | 162 // You can call this function to release all memory blocks allocated by
the library. |
| 174 // After this function called, you should not call any PDF processing f
unctions. | 163 // After this function called, you should not call any PDF processing f
unctions. |
| 175 DLLEXPORT void STDCALL FPDF_DestroyLibrary(); | 164 DLLEXPORT void STDCALL FPDF_DestroyLibrary(); |
| 176 | 165 |
| 177 //Policy for accessing the local machine time. | 166 //Policy for accessing the local machine time. |
| 178 #define FPDF_POLICY_MACHINETIME_ACCESS 0 | 167 #define FPDF_POLICY_MACHINETIME_ACCESS 0 |
| 179 | 168 |
| 180 // Function: FPDF_SetSandBoxPolicy | 169 // Function: FPDF_SetSandBoxPolicy |
| 181 // Set the policy for the sandbox environment. | 170 // Set the policy for the sandbox environment. |
| 182 // Parameters: | 171 // Parameters: |
| 183 // policy - The specified policy for setting, for example:FPDF_P
OLICY_MACHINETIME_ACCESS. | 172 // policy - The specified policy for setting, for example:FPDF_P
OLICY_MACHINETIME_ACCESS. |
| 184 // enable - True for enable, False for disable the policy. | 173 // enable - True for enable, False for disable the policy. |
| 185 // Return value: | 174 // Return value: |
| 186 // None. | 175 // None. |
| 187 DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enabl
e); | 176 DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enabl
e); |
| 188 | 177 |
| 189 /** | 178 // Function: FPDF_LoadDocument |
| 190 * Open and load a PDF document. | 179 // Open and load a PDF document. |
| 191 * @param[in] file_path - Path to the PDF file (including extension). | 180 // Parameters: |
| 192 * @param[in] password - A string used as the password for PDF file. | 181 // file_path [in] - Path to the PDF file (including extension). |
| 193 * If no password needed, empty or NULL can be used. | 182 // password [in] - A string used as the password for PDF file. |
| 194 * @note Loaded document can be closed by FPDF_CloseDocument. | 183 // If no password needed, empty or NULL can be used. |
| 195 * If this function fails, you can use FPDF_GetLastError() to retrieve | 184 // Return value: |
| 196 * the reason why it fails. | 185 // A handle to the loaded document, or NULL on failure. |
| 197 * The application should call ::FPDF_LoadXFA function after PDF docume
nt loaded | 186 // Comments: |
| 198 * to support XFA fields in fpdfformfill.h file. | 187 // Loaded document can be closed by FPDF_CloseDocument(). |
| 199 * | 188 // If this function fails, you can use FPDF_GetLastError() to retrieve |
| 200 * @retval A handle to the loaded document. If failed, NULL is returned. | 189 // the reason why it failed. |
| 201 */ | 190 // The application should call ::FPDF_LoadXFA function after PDF docume
nt loaded |
| 191 // to support XFA fields in fpdfformfill.h file. |
| 202 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, | 192 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, |
| 203 FPDF_BYTESTRING password); | 193 FPDF_BYTESTRING password); |
| 204 | 194 |
| 205 // Function: FPDF_LoadMemDocument | 195 // Function: FPDF_LoadMemDocument |
| 206 // Open and load a PDF document from memory. | 196 // Open and load a PDF document from memory. |
| 207 // Parameters: | 197 // Parameters: |
| 208 // data_buf - Pointer to a buffer containing the PDF document. | 198 // data_buf - Pointer to a buffer containing the PDF document. |
| 209 // size - Number of bytes in the PDF document. | 199 // size - Number of bytes in the PDF document. |
| 210 // password - A string used as the password for PDF file. | 200 // password - A string used as the password for PDF file. |
| 211 // If no password needed, empty or NULL can be used. | 201 // If no password needed, empty or NULL can be used. |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 // Parameters: | 420 // Parameters: |
| 431 // document - Handle to document. Returned by FPDF_LoadDocument fu
nction. | 421 // document - Handle to document. Returned by FPDF_LoadDocument fu
nction. |
| 432 // page_index - Page index, zero for the first page. | 422 // page_index - Page index, zero for the first page. |
| 433 // width - Pointer to a double value receiving the page width (
in points). | 423 // width - Pointer to a double value receiving the page width (
in points). |
| 434 // height - Pointer to a double value receiving the page height
(in points). | 424 // height - Pointer to a double value receiving the page height
(in points). |
| 435 // Return value: | 425 // Return value: |
| 436 // Non-zero for success. 0 for error (document or page not found). | 426 // Non-zero for success. 0 for error (document or page not found). |
| 437 // | 427 // |
| 438 DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_i
ndex, double* width, double* height); | 428 DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_i
ndex, double* width, double* height); |
| 439 | 429 |
| 440 | |
| 441 // Page rendering flags. They can be combined with bit OR. | 430 // Page rendering flags. They can be combined with bit OR. |
| 442 #define FPDF_ANNOT 0x01 // Set if annotations are to be rendered
. | 431 #define FPDF_ANNOT 0x01 // Set if annotations are to be rendered
. |
| 443 #define FPDF_LCD_TEXT 0x02 // Set if using text rendering optimized
for LCD display. | 432 #define FPDF_LCD_TEXT 0x02 // Set if using text rendering optimized
for LCD display. |
| 444 #define FPDF_NO_NATIVETEXT 0x04 // Don't use the native text output avai
lable on some platforms | 433 #define FPDF_NO_NATIVETEXT 0x04 // Don't use the native text output avai
lable on some platforms |
| 445 #define FPDF_GRAYSCALE 0x08 // Grayscale output. | 434 #define FPDF_GRAYSCALE 0x08 // Grayscale output. |
| 446 #define FPDF_DEBUG_INFO 0x80 // Set if you want to get some debug inf
o. | 435 #define FPDF_DEBUG_INFO 0x80 // Set if you want to get some debug inf
o. |
| 447 // Please discuss with Foxit first if yo
u need to collect debug info. | 436 // Please discuss with Foxit first if yo
u need to collect debug info. |
| 448 #define FPDF_NO_CATCH 0x100 // Set if you don't want to catch except
ion. | 437 #define FPDF_NO_CATCH 0x100 // Set if you don't want to catch except
ion. |
| 449 #define FPDF_RENDER_LIMITEDIMAGECACHE 0x200 // Limit image cache size. | 438 #define FPDF_RENDER_LIMITEDIMAGECACHE 0x200 // Limit image cache size. |
| 450 #define FPDF_RENDER_FORCEHALFTONE 0x400 // Always use halftone for image
stretching. | 439 #define FPDF_RENDER_FORCEHALFTONE 0x400 // Always use halftone for image
stretching. |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 | 753 |
| 765 // Function: FPDF_BStr_Clear | 754 // Function: FPDF_BStr_Clear |
| 766 // Helper function to clear a byte string. | 755 // Helper function to clear a byte string. |
| 767 DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Clear(FPDF_BSTR* str); | 756 DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Clear(FPDF_BSTR* str); |
| 768 | 757 |
| 769 #ifdef __cplusplus | 758 #ifdef __cplusplus |
| 770 } | 759 } |
| 771 #endif | 760 #endif |
| 772 | 761 |
| 773 #endif // PUBLIC_FPDFVIEW_H_ | 762 #endif // PUBLIC_FPDFVIEW_H_ |
| OLD | NEW |