fpdf_document_r.h
Go to the documentation of this file.
1 
31 #ifndef _FSPDF_DOCUMENT_R_H_
32 #define _FSPDF_DOCUMENT_R_H_
33 
121 #ifdef __cplusplus
122 extern "C" {
123 #endif
124 
125 /*******************************************************************************/
126 /* Document level macros */
127 /*******************************************************************************/
128 #ifndef _FSPDF_DEF_MACRO_PASSWORDTYPE_
129 #define _FSPDF_DEF_MACRO_PASSWORDTYPE_
130 
138 #define FSPDF_PASSWORDTYPE_INVALID -1
139 
140 #define FSPDF_PASSWORDTYPE_NOPASSWORD 0
141 
142 #define FSPDF_PASSWORDTYPE_USERPASSWORD 1
143 
144 #define FSPDF_PASSWORDTYPE_OWNERPASSWORD 2
145 
147 #endif /* _FSPDF_DEF_MACRO_PASSWORDTYPE_ */
148 
149 #ifndef _FSPDF_DEF_MACRO_ENCRYPTIONTYPE_
150 #define _FSPDF_DEF_MACRO_ENCRYPTIONTYPE_
151 
157 #define FSPDF_ENCRYPTTYPE_NOENCRYPT 0
158 
159 #define FSPDF_ENCRYPTTYPE_PASSWORD 1
160 
161 #define FSPDF_ENCRYPTTYPE_CERTIFICATE 2
162 
163 #define FSPDF_ENCRYPTTYPE_FOXITDRM 3
164 
165 #define FSPDF_ENCRYPTTYPE_CUSTOM 4
166 
167 #define FSPDF_ENCRYPTTYPE_RMS 5
168 
170 #endif /* _FSPDF_DEF_MACRO_ENCRYPTIONTYPE_ */
171 
172 #ifndef _FSPDF_DEF_MACRO_DISPLAYMODE_
173 #define _FSPDF_DEF_MACRO_DISPLAYMODE_
174 
183 #define FSPDF_DISPLAYMODE_USENONE 0
184 
185 #define FSPDF_DISPLAYMODE_USEOUTLINES 1
186 
187 #define FSPDF_DISPLAYMODE_USETHUMBS 2
188 
189 #define FSPDF_DISPLAYMODE_FULLSCREEN 3
190 
191 #define FSPDF_DISPLAYMODE_USEOC 4
192 
193 #define FSPDF_DISPLAYMODE_USEATTACHMENTS 5
194 
196 #endif /* _FSPDF_DEF_MACRO_DISPLAYMODE_ */
197 
198 #ifndef _FSPDF_DEF_MACRO_LOADFLAG_
199 #define _FSPDF_DEF_MACRO_LOADFLAG_
200 
210 #define FSPDF_LOADFLAG_NOSTREAMCACHES 0x1
211 
213 #define FSPDF_LOADFLAG_RELEASEFILEHANDLE 0x2
214 
216 #endif /* _FSPDF_DEF_MACRO_LOADFLAG_ */
217 
218 
219 
220 /*******************************************************************************/
221 /* PDF document load or reload */
222 /*******************************************************************************/
260 FS_RESULT FSPDF_Doc_StartLoad(FSCRT_FILE file, const FSCRT_BSTR* password, FSCRT_DOCUMENT* document, FSCRT_PROGRESS* progress);
261 
302 FS_RESULT FSPDF_Doc_StartLoadWithFlag(FSCRT_FILE file, const FSCRT_BSTR* password, FS_DWORD flag, FSCRT_DOCUMENT* document, FSCRT_PROGRESS* progress);
303 
338 FS_RESULT FSPDF_Doc_StartReLoad(FSCRT_DOCUMENT document, FSCRT_FILE file, const FSCRT_BSTR* password, FSCRT_PROGRESS* progress);
339 
364 FS_RESULT FSPDF_Doc_Close(FSCRT_DOCUMENT document);
365 
366 /*******************************************************************************/
367 /* Document objects */
368 /* */
369 /* Catalog, trailer, encrypt and document info dictionary */
370 /*******************************************************************************/
401 FS_RESULT FSPDF_Doc_GetCatalog(FSCRT_DOCUMENT document, FSPDF_OBJECT* object);
402 
434 FS_RESULT FSPDF_Doc_GetTrailer(FSCRT_DOCUMENT document, FSPDF_OBJECT* trailer);
435 
466 FS_RESULT FSPDF_Doc_GetInfoDict(FSCRT_DOCUMENT document, FSPDF_OBJECT* object);
467 
498 FS_RESULT FSPDF_Doc_GetEncryptDict(FSCRT_DOCUMENT document, FSPDF_OBJECT* object);
499 
500 /*******************************************************************************/
501 /* Access PDF document properties */
502 /*******************************************************************************/
533 FS_RESULT FSPDF_Doc_GetPasswordType(FSCRT_DOCUMENT document, FS_INT32* type);
534 
567 FS_RESULT FSPDF_Doc_GetEncryptionType(FSCRT_DOCUMENT document, FS_INT32* type);
568 
602 FS_RESULT FSPDF_Doc_GetEncryptionFilter(FSCRT_DOCUMENT document, FSCRT_BSTR* filter);
603 
634 FS_RESULT FSPDF_Doc_GetEncryptionSubFilter(FSCRT_DOCUMENT document, FSCRT_BSTR* subFilter);
635 
668 FS_RESULT FSPDF_Doc_GetEncryptionParam(FSCRT_DOCUMENT document, const FSCRT_BSTR* key, FSCRT_BSTR* value);
669 
696 FS_RESULT FSPDF_Doc_GetUserPermissions(FSCRT_DOCUMENT document, FS_DWORD* permissions);
697 
726 FS_RESULT FSPDF_Doc_GetDisplayMode(FSCRT_DOCUMENT document, FS_INT32* displayMode);
727 
752 FS_RESULT FSPDF_Doc_GetFileVersion(FSCRT_DOCUMENT document, FS_INT32* version);
753 
778 FS_RESULT FSPDF_Doc_IsModified(FSCRT_DOCUMENT document, FS_BOOL* isModified);
779 
804 FS_RESULT FSPDF_Doc_IsPortfolio(FSCRT_DOCUMENT document, FS_BOOL* isPortfolio);
805 
806 /*******************************************************************************/
807 /* Get PDF page object */
808 /*******************************************************************************/
833 FS_RESULT FSPDF_Doc_CountPages(FSCRT_DOCUMENT document, FS_INT32* count);
834 
864 FS_RESULT FSPDF_Doc_GetPage(FSCRT_DOCUMENT document, FS_INT32 index, FSCRT_PAGE* page);
865 
866 #ifndef _FSPDF_DEF_STRUCTURE_ENUMPAGEINFOHANDLER_
867 #define _FSPDF_DEF_STRUCTURE_ENUMPAGEINFOHANDLER_
868 
875 typedef struct _FSPDF_ENUMPAGEINFOHANDLER
876 {
881 
888 
889  /*
890  * @brief Enumerate page size for each PDF page.
891  *
892  * @details Foxit SDK calls this function to enumerate page size for each page, and the application can get page size quickly
893  * from the parameter <i>pageWidth</i> and <i>pageHeight</i>, with <i>pageIndex</i> in this callback function.<br>
894  * Application is not suggested to call any API of Foxit SDK inside this callback function since it may reduce the speed of enumerating all page size.
895  *
896  * @param[in] clientData Pointer to user-defined data.
897  * @param[in] pageIndex Index of a PDF page, starting from 0.
898  * @param[in] pageWidth Width of a PDF page.
899  * @param[in] pageHeight Height of a PDF page.
900  *
901  * @return ::FSCRT_ERRCODE_SUCCESS for success.<br>
902  * ::FSCRT_ERRCODE_UNRECOVERABLE if function finds an unrecoverable error internally.<br>
903  * For more error codes, please refer to macro definitions {@link FSCRT_ERRCODE_SUCCESS FSCRT_ERRCODE_XXX}.
904  */
905  FS_RESULT (*EnumPageSize)(FS_LPVOID clientData, FS_INT32 pageIndex, FS_FLOAT pageWidth, FS_FLOAT pageHeight);
906 
907  /*
908  * @brief Enumerate page rotation for each PDF page.
909  *
910  * @details Foxit SDK calls this function to enumerate page rotation for each page, and the application can get page rotation quickly
911  * from the parameter <i>pageRotation</i>, with <i>pageIndex</i> in this callback function.<br>
912  * Application is not suggested to call any API of Foxit SDK inside this callback function since it may reduce the speed of enumerating all page rotations.
913  *
914  * @param[in] clientData Pointer to user-defined data.
915  * @param[in] pageIndex Index of a PDF page, starting from 0.
916  * @param[in] pageRotation Rotation of a PDF page.
917  * Please refer to macro definitions {@link FSCRT_PAGEROTATION_0 FSCRT_PAGEROTATION_XXX} and this should be one of these macros.
918  *
919  * @return ::FSCRT_ERRCODE_SUCCESS for success.<br>
920  * ::FSCRT_ERRCODE_UNRECOVERABLE if function finds an unrecoverable error internally.<br>
921  * For more error codes, please refer to macro definitions {@link FSCRT_ERRCODE_SUCCESS FSCRT_ERRCODE_XXX}.
922  */
923  FS_RESULT (*EnumPageRotation)(FS_LPVOID clientData, FS_INT32 pageIndex, FS_INT32 pageRotation);
925 
926 #endif //_FSPDF_DEF_STRUCTURE_ENUMPAGEINFOHANDLER_
927 
956 FS_RESULT FSPDF_Doc_EnumPagesInfo(FSCRT_DOCUMENT document, FSPDF_ENUMPAGEINFOHANDLER* enumHandler);
957 
958 /*******************************************************************************/
959 /* Access PDF Wrapper */
960 /*******************************************************************************/
961 #ifndef _FSPDF_DEF_STRUCTURE_WRAPPERDATA_
962 #define _FSPDF_DEF_STRUCTURE_WRAPPERDATA_
963 
969 typedef struct _FSPDF_WRAPPERDATA
970 {
981 
983 
984 #endif /* _FSPDF_DEF_STRUCTURE_WRAPPERDATA_ */
985 
1009 
1033 
1067 FS_RESULT FSPDF_Doc_IsWrapper(FSCRT_DOCUMENT document, FS_BOOL* isWrapper);
1068 
1101 FS_RESULT FSPDF_Doc_GetWrapperOffset(FSCRT_DOCUMENT document, FSCRT_FILESIZE* offset);
1102 
1134 FS_RESULT FSPDF_Doc_GetWrapperData(FSCRT_DOCUMENT document, FSPDF_WRAPPERDATA* wrapperData);
1135 
1136 
1137 /*******************************************************************************/
1138 /* Document trigger actions */
1139 /*******************************************************************************/
1167 FS_RESULT FSPDF_Doc_CountActions(FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32* count);
1168 
1199 FS_RESULT FSPDF_Doc_GetAction(FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index, FSPDF_ACTIONDATA* actionData);
1200 
1201 
1202 /*******************************************************************************/
1203 /* PDF action handler */
1204 /*******************************************************************************/
1205 
1206 #ifndef _FSPDF_DEF_STRUCTURE_IDENTITYPROPERTIES_
1207 #define _FSPDF_DEF_STRUCTURE_IDENTITYPROPERTIES_
1208 
1210 typedef struct _FSPDF_IDENTITYPROPERTIES
1211 {
1221 
1222 #endif /* _FSPDF_IDENTITYPROPERTIES */
1223 
1224 #ifndef _FSPDF_DEF_STRUCTURE_MENULIST_
1225 #define _FSPDF_DEF_STRUCTURE_MENULIST_
1226 
1228 typedef struct _FSPDF_MENULIST
1229 {
1235 
1236 #endif /* _FSPDF_MENULIST */
1237 
1238 #ifndef _FSPDF_DEF_MACRO_APPINFO_
1239 #define _FSPDF_DEF_MACRO_APPINFO_
1240 
1246 #define FSPDF_APPINFOTYPE_FORMSVERSION 0x0
1247 
1249 #define FSPDF_APPINFOTYPE_VIEWERTYPE 0x1
1250 
1252 #define FSPDF_APPINFOTYPE_VIEWERVARIATION 0x2
1253 
1255 #define FSPDF_APPINFOTYPE_VIEWERVERSION 0x3
1256 
1258 #define FSPDF_APPINFOTYPE_APPVERSION 0x4
1259 
1261 #endif /* _FSPDF_DEF_MACRO_APPINFO_ */
1262 
1263 #ifndef _FSPDF_DEF_MACRO_MAILTYPE_
1264 #define _FSPDF_DEF_MACRO_MAILTYPE_
1265 
1271 #define FSPDF_MAILTYPE_DOC 0
1272 
1274 #define FSPDF_MAILTYPE_FORM 1
1275 
1277 #define FSPDF_MAILTYPE_MSG 2
1278 
1280 #endif /* _FSPDF_DEF_MACRO_MAILTYPE_ */
1281 
1282 #ifndef _FSPDF_DEF_HANDLER_JAVASCRIPT_ACTION_
1283 #define _FSPDF_DEF_HANDLER_JAVASCRIPT_ACTION_
1284 
1291 typedef struct _FSPDF_JAVASCRIPTACTION_HANDLER
1292 {
1299 
1306 
1318  FS_RESULT (*Release)(FS_LPVOID clientData);
1319 
1335  FS_RESULT (*InvalidateRect)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 pageIndex, FSCRT_RECTF* pdfRect);
1336 
1348  FS_RESULT (*GetCurrentPageIndex)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32* pageIndex);
1349 
1360  FS_RESULT (*SetCurrentPageIndex)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 pageIndex);
1361 
1374  FS_RESULT (*GetRotation)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 pageIndex, FS_INT32* rotation);
1375 
1388  FS_RESULT (*ExecuteNamedAction)(FS_LPVOID clientData, FSCRT_DOCUMENT document, const FSCRT_BSTR* namedAction);
1389 
1400  FS_RESULT (*SetChangeMark)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL changeMark);
1401 
1412  FS_RESULT (*GetChangeMark)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL* changeMark);
1413 
1438  FS_RESULT (*GetOpenedDocs)(FS_LPVOID clientData, FSCRT_DOCUMENT* docs, FS_INT32* count);
1439 
1471  FS_RESULT (*Alert)(FS_LPVOID clientData, const FSCRT_BSTR* msg, const FSCRT_BSTR* title, FS_INT32 type, FS_INT32 icon, FS_INT32* retCode);
1472 
1489  FS_RESULT (*Beep)(FS_LPVOID clientData, FS_INT32 type);
1490 
1510  FS_RESULT (*Response)(FS_LPVOID clientData, const FSCRT_BSTR* question, const FSCRT_BSTR* title, const FSCRT_BSTR* defaultValue,
1511  const FSCRT_BSTR* label, FS_BOOL isPassword, FSCRT_BSTR* response);
1512 
1524  FS_RESULT (*GetFilePath)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FSCRT_BSTR* filePath);
1525 
1548  FS_RESULT (*Mail)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL bUI, const FSCRT_BSTR* To,
1549  const FSCRT_BSTR* Subject, const FSCRT_BSTR* CC, const FSCRT_BSTR* BCC, const FSCRT_BSTR* Msg);
1550 
1569  FS_RESULT (*Print)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL isUI, FS_INT32 start, FS_INT32 end, FS_BOOL isSilent ,
1570  FS_BOOL isShrinkToFit, FS_BOOL isPrintAsImage, FS_BOOL isReverse, FS_BOOL isAnnotations);
1571 
1584  FS_RESULT (*SubmitForm)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_LPVOID formData, FS_DWORD length, const FSCRT_BSTR* URL);
1585 
1595  FS_RESULT (*LaunchURL)(FS_LPVOID clientData, const FSCRT_BSTR* URL);
1596 
1609  FS_RESULT (*BrowseFile)(FS_LPVOID clientData, FSCRT_BSTR* filePath);
1610 
1621  FS_RESULT (*GetLanguage)(FS_LPVOID clientData, FS_INT32* language);
1622 
1623  /*
1624  * @brief Optional callback function to get identity properties of the current user.
1625  *
1626  * @param[in] clientData The user-supplied data.
1627  * @param[out] identityProperties Pointer to a ::FSPDF_IDENTITYPROPERTIES structure that receives the identity properties.
1628  *
1629  * @return ::FSCRT_ERRCODE_SUCCESS for success.<br>
1630  * For more error codes, please refer to macro definitions {@link FSCRT_ERRCODE_SUCCESS FSCRT_ERRCODE_XXX}.
1631  */
1632  FS_RESULT (*GetIdentityProperties)(FS_LPVOID clientData, FSPDF_IDENTITYPROPERTIES* identityProperties);
1633 
1648  FS_RESULT (*PopupMenu)(FS_LPVOID clientData, const FSPDF_MENULIST* menus, FS_INT32 count, FSCRT_BSTR* seletedMenu);
1649 
1663  FS_RESULT (*GetAppInfo)(FS_LPVOID clientData, FS_INT32 type, FSCRT_BSTR* info);
1664 
1697  FS_RESULT (*MailData)(FS_LPVOID clientData, FS_LPVOID data, FS_DWORD dataType, FS_BOOL bUI, const FSCRT_BSTR* To,
1698  const FSCRT_BSTR* Subject, const FSCRT_BSTR* CC, const FSCRT_BSTR* BCC, const FSCRT_BSTR* Msg);
1699 
1701 
1702 #endif /* _FSPDF_DEF_HANDLER_JAVASCRIPT_ACTION_ */
1703 
1727 FS_RESULT FSPDF_Doc_SetJavaScriptActionHandler(FSCRT_DOCUMENT document, FSPDF_JAVASCRIPTACTION_HANDLER* actionHandler);
1728 
1751 FS_RESULT FSPDF_Doc_InitiateJavaScript(FSCRT_DOCUMENT document);
1752 
1777 FS_RESULT FSPDF_Doc_DoJavaScriptAction(FSCRT_DOCUMENT document, FS_INT32 trigger);
1778 
1806 FS_RESULT FSPDF_Doc_GetJSActionByName(FSCRT_DOCUMENT document, const FSCRT_BSTR* name, FSPDF_ACTIONDATA* actionData);
1807 
1808 /*******************************************************************************/
1809 /* PDF page label */
1810 /*******************************************************************************/
1811 
1812 #ifndef _FSPDF_DEF_MACRO_PAGELABEL_STYLE_
1813 #define _FSPDF_DEF_MACRO_PAGELABEL_STYLE_
1814 
1821 #define FSPDF_PAGELABEL_STYLE_None 0
1822 
1823 #define FSPDF_PAGELABEL_STYLE_D 1
1824 
1825 #define FSPDF_PAGELABEL_STYLE_R 2
1826 
1827 #define FSPDF_PAGELABEL_STYLE_r 3
1828 
1829 #define FSPDF_PAGELABEL_STYLE_A 4
1830 
1831 #define FSPDF_PAGELABEL_STYLE_a 5
1832 
1834 #endif /* _FSPDF_DEF_MACRO_PAGELABEL_STYLE_ */
1835 
1866 FS_RESULT FSPDF_Doc_PageLabelToPageIndex(FSCRT_DOCUMENT document, FS_BOOL noCase, const FSCRT_BSTR* pageLabel, FS_INT32* pageIndex);
1867 
1899 FS_RESULT FSPDF_Doc_PageIndexToPageLabel(FSCRT_DOCUMENT document, FS_INT32 pageIndex, FSCRT_BSTR* pageLabel);
1900 
1928 FS_RESULT FSPDF_PageLabels_CountRanges(FSCRT_DOCUMENT document, FS_INT32* count);
1929 
1970 FS_RESULT FSPDF_PageLabels_GetRangeInfo(FSCRT_DOCUMENT document, FS_INT32 rangeIndex, FS_INT32* start, FS_INT32* style, FSCRT_BSTR* prefix, FS_INT32* st);
1971 
1972 /*******************************************************************************/
1973 /* Access PDF metadata */
1974 /*******************************************************************************/
2025 FS_RESULT FSPDF_Metadata_GetString(FSCRT_DOCUMENT document, const FSCRT_BSTR* key, FSCRT_BSTR* string);
2026 
2076 FS_RESULT FSPDF_Metadata_GetStringArray(FSCRT_DOCUMENT document, const FSCRT_BSTR* key, FSCRT_ARRAY* stringArray);
2077 
2118 FS_RESULT FSPDF_Metadata_GetDateTime(FSCRT_DOCUMENT document, const FSCRT_BSTR* key, FSCRT_DATETIMEZONE* dt);
2119 
2120 /*******************************************************************************/
2121 /* Access PDF bookmarks */
2122 /*******************************************************************************/
2123 #ifndef _FSPDF_DEF_HANDLE_BOOKMARK_ITERATOR_
2124 #define _FSPDF_DEF_HANDLE_BOOKMARK_ITERATOR_
2125 
2127 FSCRT_DEFINEHANDLE(FSPDF_BOOKMARK_ITERATOR);
2128 
2129 #endif /* _FSPDF_DEF_HANDLE_BOOKMARK_ITERATOR_ */
2130 
2131 #ifndef _FSPDF_DEF_HANDLE_BOOKMARK_POS_
2132 #define _FSPDF_DEF_HANDLE_BOOKMARK_POS_
2133 
2135 FSCRT_DEFINEHANDLE(FSPDF_BOOKMARKPOS);
2136 
2137 #endif /* _FSPDF_DEF_HANDLE_BOOKMARK_POS_ */
2138 
2139 #ifndef _FSPDF_DEF_MACRO_BOOKMARKSTATUS_
2140 #define _FSPDF_DEF_MACRO_BOOKMARKSTATUS_
2141 
2149 #define FSPDF_BOOKMARKSTATUS_NORMAL 0
2150 
2151 #define FSPDF_BOOKMARKSTATUS_BOLD 1
2152 
2153 #define FSPDF_BOOKMARKSTATUS_ITALIC 2
2154 
2159 #define FSPDF_BOOKMARKSTATUS_EXPANDED 4
2160 
2162 #endif /* _FSPDF_DEF_MACRO_BOOKMARKSTATUS_ */
2163 
2164 #ifndef _FSPDF_DEF_MACRO_BOOKMARKPOS_
2165 #define _FSPDF_DEF_MACRO_BOOKMARKPOS_
2166 
2174 #define FSPDF_BOOKMARKPOS_FIRSTCHILD 0
2175 
2176 #define FSPDF_BOOKMARKPOS_LASTCHILD 1
2177 
2178 #define FSPDF_BOOKMARKPOS_PREVIOUS 2
2179 
2180 #define FSPDF_BOOKMARKPOS_NEXT 3
2181 
2182 #define FSPDF_BOOKMARKPOS_FIRSTSIBLING 4
2183 
2184 #define FSPDF_BOOKMARKPOS_LASTSIBLING 5
2185 
2187 #endif /* _FSPDF_DEF_MACRO_BOOKMARKPOS_ */
2188 
2189 #ifndef _FSPDF_DEF_STRUCTURE_BOOKMARKDATA_
2190 #define _FSPDF_DEF_STRUCTURE_BOOKMARKDATA_
2191 
2197 typedef struct _FSPDF_BOOKMARKDATA_
2198 {
2210 
2211 #endif /* _FSPDF_DEF_STRUCTURE_BOOKMARKDATA_ */
2212 
2236 
2261 
2290 FS_RESULT FSPDF_Doc_CreateBookmarkIterator(FSCRT_DOCUMENT document, FSPDF_BOOKMARK_ITERATOR* iterator);
2291 
2315 FS_RESULT FSPDF_Bookmark_GetPos(FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKPOS* pos);
2316 
2344 FS_RESULT FSPDF_Bookmark_CloneIterator(FSPDF_BOOKMARK_ITERATOR srcIterator, FSPDF_BOOKMARK_ITERATOR* clonedIterator);
2345 
2365 FS_RESULT FSPDF_Bookmark_ReleaseIterator(FSPDF_BOOKMARK_ITERATOR iterator);
2366 
2386 FS_RESULT FSPDF_Bookmark_ReleasePos(FSPDF_BOOKMARKPOS pos);
2387 
2407 FS_RESULT FSPDF_Bookmark_MoveToRoot(FSPDF_BOOKMARK_ITERATOR iterator);
2408 
2434 FS_RESULT FSPDF_Bookmark_IsRoot(FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL* isRoot);
2435 
2456 FS_RESULT FSPDF_Bookmark_MoveToParent(FSPDF_BOOKMARK_ITERATOR iterator);
2457 
2478 FS_RESULT FSPDF_Bookmark_MoveToFirstChild(FSPDF_BOOKMARK_ITERATOR iterator);
2479 
2500 FS_RESULT FSPDF_Bookmark_MoveToNextSibling(FSPDF_BOOKMARK_ITERATOR iterator);
2501 
2522 FS_RESULT FSPDF_Bookmark_MoveToPrevSibling(FSPDF_BOOKMARK_ITERATOR iterator);
2523 
2546 FS_RESULT FSPDF_Bookmark_MoveToPos(FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKPOS newPos);
2547 
2573 FS_RESULT FSPDF_Bookmark_HasChild(FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL* hasChild);
2574 
2600 FS_RESULT FSPDF_Bookmark_IsFirstChild(FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL* isFirstChild);
2601 
2627 FS_RESULT FSPDF_Bookmark_IsLastChild(FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL* isLastChild);
2628 
2650 FS_RESULT FSPDF_Bookmark_GetData(FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKDATA* bmData);
2651 
2674 FS_RESULT FSPDF_Bookmark_CountActions(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32* count);
2675 
2700 FS_RESULT FSPDF_Bookmark_GetAction(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index, FSPDF_ACTIONDATA* actionData);
2701 
2702 /*******************************************************************************/
2703 /* Access PDF viewer preferences */
2704 /*******************************************************************************/
2705 #ifndef _FSPDF_DEF_MACRO_READDIREC_
2706 #define _FSPDF_DEF_MACRO_READDIREC_
2707 
2711 #define FSPDF_READDIRECT_L2R 0
2712 
2713 #define FSPDF_READDIRECT_R2L 1
2714 
2716 #endif /* _FSPDF_DEF_MACRO_READDIREC_ */
2717 
2757 FS_RESULT FSPDF_ViewerPref_GetUIVisibility(FSCRT_DOCUMENT document, const FSCRT_BSTR* uiItem, FS_BOOL* uiVisible);
2758 
2794 FS_RESULT FSPDF_ViewerPref_GetNonFullScreenPageMode(FSCRT_DOCUMENT document, FS_INT32* displayMode);
2795 
2826 FS_RESULT FSPDF_ViewerPref_GetReadingDirection(FSCRT_DOCUMENT document, FS_INT32* direction);
2827 
2866 FS_RESULT FSPDF_ViewerPref_GetAreaType(FSCRT_DOCUMENT document, const FSCRT_BSTR* boxItem, FS_INT32* boxType);
2867 
2904 FS_RESULT FSPDF_ViewerPref_GetPrintScale(FSCRT_DOCUMENT document, FSCRT_BSTR* printScale);
2905 
2935 FS_RESULT FSPDF_ViewerPref_GetPrintCopies(FSCRT_DOCUMENT document, FS_INT32* copies);
2936 
2973 FS_RESULT FSPDF_ViewerPref_GetPrintRanges(FSCRT_DOCUMENT document, FS_INT32* pageRanges, FS_INT32* count);
2974 
2975 /*******************************************************************************/
2976 /* PDF attachments */
2977 /*******************************************************************************/
2978 #ifndef _FSPDF_DEF_HANDLE_ATTACHMENTS_
2979 #define _FSPDF_DEF_HANDLE_ATTACHMENTS_
2980 
2982 FSCRT_DEFINEHANDLE(FSPDF_ATTACHMENTS);
2983 
2984 #endif /* _FSPDF_DEF_HANDLE_ATTACHMENTS_ */
2985 
3012 FS_RESULT FSPDF_Doc_LoadAttachments(FSCRT_DOCUMENT document, FSPDF_ATTACHMENTS* attachments);
3013 
3033 FS_RESULT FSPDF_Attachments_Release(FSPDF_ATTACHMENTS attachments);
3034 
3055 FS_RESULT FSPDF_Attachments_CountAttachment(FSPDF_ATTACHMENTS attachments, FS_INT32* count);
3056 
3080 FS_RESULT FSPDF_Attachments_GetAttachment(FSPDF_ATTACHMENTS attachments, FS_INT32 index, FSPDF_ATTACHMENT* attachment);
3081 
3082 /*******************************************************************************/
3083 /* PDF Fonts */
3084 /*******************************************************************************/
3107 FS_RESULT FSPDF_Doc_CountFonts(FSCRT_DOCUMENT document, FS_INT32* count);
3108 
3135 FS_RESULT FSPDF_Doc_GetFontByIndex(FSCRT_DOCUMENT document, FS_INT32 index, FSCRT_FONT* font);
3136 
3137 /*******************************************************************************/
3138 /* Memory optimition */
3139 /*******************************************************************************/
3163 FS_RESULT FSPDF_Doc_ClearCache(FSCRT_DOCUMENT document);
3164 
3165 
3166 #ifdef __cplusplus
3167 };
3168 #endif
3169  /* group FPDFDOCUMENT */
3171 
3172 #endif /* _FSPDF_DOCUMENT_R_H_ */
3173 
FS_RESULT FSPDF_Doc_IsWrapper(FSCRT_DOCUMENT document, FS_BOOL *isWrapper)
Determine whether the document is a wrapper document or not.
FS_RESULT FSPDF_Bookmark_MoveToRoot(FSPDF_BOOKMARK_ITERATOR iterator)
Move a bookmark iterator to root.
FS_RESULT FSPDF_Doc_SetJavaScriptActionHandler(FSCRT_DOCUMENT document, FSPDF_JAVASCRIPTACTION_HANDLER *actionHandler)
Set the action handler to the PDF document.
FS_RESULT FSPDF_Doc_CreateBookmarkIterator(FSCRT_DOCUMENT document, FSPDF_BOOKMARK_ITERATOR *iterator)
Create an iterator to access bookmark in a document.
FS_RESULT FSPDF_Attachments_CountAttachment(FSPDF_ATTACHMENTS attachments, FS_INT32 *count)
Get the count of attachments.
FS_RESULT FSPDF_ViewerPref_GetAreaType(FSCRT_DOCUMENT document, const FSCRT_BSTR *boxItem, FS_INT32 *boxType)
Get the type of area item from viewer preferences.
FS_RESULT FSPDF_Attachments_Release(FSPDF_ATTACHMENTS attachments)
Release a attachments object.
Structure for identity properties of the current user of the application.
Definition: fpdf_document_r.h:1210
Structure for rectangle, in float.
Definition: fs_base_r.h:2078
FS_RESULT FSPDF_Doc_GetInfoDict(FSCRT_DOCUMENT document, FSPDF_OBJECT *object)
Get the PDF document info object.
float FS_FLOAT
32-bit floating-point number, single precision.
Definition: fs_base_r.h:148
FS_RESULT FSPDF_ViewerPref_GetReadingDirection(FSCRT_DOCUMENT document, FS_INT32 *direction)
Get reading direction from viewer preferences.
FS_RESULT FSPDF_Metadata_GetString(FSCRT_DOCUMENT document, const FSCRT_BSTR *key, FSCRT_BSTR *string)
Get a UTF-8 string value from metadata.
FS_RESULT FSPDF_Bookmark_GetAction(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index, FSPDF_ACTIONDATA *actionData)
Get bookmark action.
FS_RESULT FSPDF_PageLabels_GetRangeInfo(FSCRT_DOCUMENT document, FS_INT32 rangeIndex, FS_INT32 *start, FS_INT32 *style, FSCRT_BSTR *prefix, FS_INT32 *st)
Get information of page labels by a specified range.
FS_RESULT FSPDF_Bookmark_GetPos(FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKPOS *pos)
Get the bookmark position handle from a bookmark iterator.
Structure for large file size.
Definition: fs_base_r.h:898
FS_RESULT FSPDF_Doc_GetCatalog(FSCRT_DOCUMENT document, FSPDF_OBJECT *object)
Get the PDF document catalog object.
FS_RESULT FSPDF_Doc_GetDisplayMode(FSCRT_DOCUMENT document, FS_INT32 *displayMode)
Get display mode specified in PDF document.
FS_RESULT FSPDF_ViewerPref_GetNonFullScreenPageMode(FSCRT_DOCUMENT document, FS_INT32 *displayMode)
Get display mode for non full-screen mode from viewer preferences.
FS_RESULT FSPDF_Doc_GetWrapperOffset(FSCRT_DOCUMENT document, FSCRT_FILESIZE *offset)
Get wrapper offset.
FS_RESULT FSPDF_PageLabels_CountRanges(FSCRT_DOCUMENT document, FS_INT32 *count)
Get count of ranges of page labels which use different numbering systems.
FS_RESULT FSPDF_WrapperData_Init(FSPDF_WRAPPERDATA *wrapperData)
Helper function to initialize a wrapper data object.
FS_RESULT FSPDF_Doc_GetAction(FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index, FSPDF_ACTIONDATA *actionData)
Get document trigger action.
FS_RESULT FSPDF_Doc_GetFileVersion(FSCRT_DOCUMENT document, FS_INT32 *version)
Get PDF file version stored in PDF header section.
FS_RESULT FSPDF_Doc_IsModified(FSCRT_DOCUMENT document, FS_BOOL *isModified)
Get PDF document modify mark.
FS_RESULT FSPDF_Bookmark_IsRoot(FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL *isRoot)
Determine whether a bookmark iterator is root or not.
unsigned int FS_DWORD
32-bit unsigned integer.
Definition: fs_base_r.h:142
FS_RESULT FSPDF_Doc_EnumPagesInfo(FSCRT_DOCUMENT document, FSPDF_ENUMPAGEINFOHANDLER *enumHandler)
Enumerate the information of all PDF pages.
FS_RESULT FSPDF_Doc_StartLoadWithFlag(FSCRT_FILE file, const FSCRT_BSTR *password, FS_DWORD flag, FSCRT_DOCUMENT *document, FSCRT_PROGRESS *progress)
Load a PDF file with the extra flags.
Structure for bookmark data.
Definition: fpdf_document_r.h:2197
FS_RESULT FSPDF_Bookmark_CloneIterator(FSPDF_BOOKMARK_ITERATOR srcIterator, FSPDF_BOOKMARK_ITERATOR *clonedIterator)
Clone an iterator to access bookmark in a document.
FSCRT_BSTR title
Bookmark title, a UTF-8 string object.
Definition: fpdf_document_r.h:2200
FS_RESULT FSPDF_Doc_CountFonts(FSCRT_DOCUMENT document, FS_INT32 *count)
Count all the PDF fonts in the document, this function would enumerate all the font resources for pag...
FS_RESULT FSPDF_Doc_InitiateJavaScript(FSCRT_DOCUMENT document)
Perform the document javascript when document is opened, defining JavaScript functions for use by oth...
FS_RESULT FSPDF_Bookmark_MoveToNextSibling(FSPDF_BOOKMARK_ITERATOR iterator)
Move a bookmark iterator to its next sibling if existing.
FS_LPVOID clientData
User-defined data.
Definition: fpdf_document_r.h:1305
FSCRT_BSTR corporation
The corporation name that the user has entered in the Identity preferences panel. ...
Definition: fpdf_document_r.h:1213
FS_RESULT FSPDF_Doc_PageLabelToPageIndex(FSCRT_DOCUMENT document, FS_BOOL noCase, const FSCRT_BSTR *pageLabel, FS_INT32 *pageIndex)
Convert a page label to page index.
int FS_INT32
32-bit signed integer.
Definition: fs_base_r.h:175
FS_RESULT FSPDF_Bookmark_CountActions(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 *count)
Get counts of bookmark action.
FS_RESULT FSPDF_Bookmark_MoveToParent(FSPDF_BOOKMARK_ITERATOR iterator)
Move a bookmark iterator to its parent if existing.
FS_RESULT FSPDF_Doc_GetEncryptionParam(FSCRT_DOCUMENT document, const FSCRT_BSTR *key, FSCRT_BSTR *value)
Get encryption parameter value.
Structure for date and time.
Definition: fs_base_r.h:2018
FS_RESULT FSPDF_Doc_StartLoad(FSCRT_FILE file, const FSCRT_BSTR *password, FSCRT_DOCUMENT *document, FSCRT_PROGRESS *progress)
Load a PDF file.
FS_RESULT FSPDF_Doc_GetEncryptionFilter(FSCRT_DOCUMENT document, FSCRT_BSTR *filter)
Get encryption filter value.
FS_RESULT FSPDF_Doc_GetUserPermissions(FSCRT_DOCUMENT document, FS_DWORD *permissions)
Get user permissions specified in PDF document.
Structure for menu list.
Definition: fpdf_document_r.h:1228
FS_RESULT FSPDF_ViewerPref_GetPrintScale(FSCRT_DOCUMENT document, FSCRT_BSTR *printScale)
Get page scaling option from viewer preferences.
FS_LPVOID clientData
User-defined data.
Definition: fpdf_document_r.h:887
FSCRT_BSTR email
The email address that the user has entered in the Identity preferences panel.
Definition: fpdf_document_r.h:1215
FSCRT_BSTR name
The title of menu.
Definition: fpdf_document_r.h:1233
FS_RESULT FSPDF_Doc_ClearCache(FSCRT_DOCUMENT document)
Clear the cache of PDF document(temporarily only for rendering), to reduce the memory usage...
Structure for page information enumeration.
Definition: fpdf_document_r.h:875
FS_RESULT FSPDF_Bookmark_GetData(FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKDATA *bmData)
Get current bookmark iterator&#39;s data which is indicated by parameter iterator.
FS_RESULT FSPDF_BookmarkData_Init(FSPDF_BOOKMARKDATA *bmData)
Helper function to initialize a bookmark data object.
Structure for an action data.
Definition: fpdf_base_r.h:841
FS_RESULT FSPDF_Doc_IsPortfolio(FSCRT_DOCUMENT document, FS_BOOL *isPortfolio)
Whether a document is a portfolio file or not.
FSCRT_BSTR type
Wrapper type to indicate a type of the current wrapper file.
Definition: fpdf_document_r.h:974
FSCRT_BSTR loginName
The login name as registered by the operating system.
Definition: fpdf_document_r.h:1217
FS_RESULT FSPDF_Attachments_GetAttachment(FSPDF_ATTACHMENTS attachments, FS_INT32 index, FSPDF_ATTACHMENT *attachment)
Get a specific attachment.
FS_RESULT FSPDF_Doc_GetJSActionByName(FSCRT_DOCUMENT document, const FSCRT_BSTR *name, FSPDF_ACTIONDATA *actionData)
Get a document JavaScript action by its action name.
FS_RESULT FSPDF_Doc_LoadAttachments(FSCRT_DOCUMENT document, FSPDF_ATTACHMENTS *attachments)
Load all attachments of PDF document.
int FS_BOOL
Boolean type (This should be TRUE or FALSE).
Definition: fs_base_r.h:133
FS_RESULT FSPDF_Doc_GetEncryptDict(FSCRT_DOCUMENT document, FSPDF_OBJECT *object)
Get the PDF document encrypt dictionary.
FS_RESULT FSPDF_Bookmark_IsLastChild(FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL *isLastChild)
Determine whether a bookmark iterator is the last child of its parent or not.
FSCRT_BSTR description
Description for wrapper file to show applications or confront users prompt information.
Definition: fpdf_document_r.h:980
Structure for action handler information.
Definition: fpdf_document_r.h:1291
FS_RESULT FSPDF_WrapperData_Clear(FSPDF_WRAPPERDATA *wrapperData)
Helper function to clear a wrapper data object.
FS_RESULT FSPDF_Bookmark_ReleaseIterator(FSPDF_BOOKMARK_ITERATOR iterator)
Release a bookmark iterator.
FS_DWORD pageInfoHandleSize
The size of this structure.
Definition: fpdf_document_r.h:880
FS_RESULT FSPDF_ViewerPref_GetPrintCopies(FSCRT_DOCUMENT document, FS_INT32 *copies)
Get the number of copies to be printed.
FS_RESULT FSPDF_Bookmark_HasChild(FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL *hasChild)
Detect whether a bookmark iterator has a child or not.
void * FS_LPVOID
A pointer to any types.
Definition: fs_base_r.h:127
FSCRT_BSTR name
The user name that the user entered in the Identity preferences panel.
Definition: fpdf_document_r.h:1219
FS_RESULT FSPDF_Doc_PageIndexToPageLabel(FSCRT_DOCUMENT document, FS_INT32 pageIndex, FSCRT_BSTR *pageLabel)
Convert a page index to page label.
FS_RESULT FSPDF_BookmarkData_Clear(FSPDF_BOOKMARKDATA *bmData)
Helper function to clear a bookmark data.
FS_INT32 level
The level of menu.
Definition: fpdf_document_r.h:1231
FSCRT_BSTR uri
URI for consumers to access for more information.
Definition: fpdf_document_r.h:978
FS_DWORD status
Current status of bookmark.
Definition: fpdf_document_r.h:2208
unsigned int FS_ARGB
ARGB color type, 32 bits, ((b) | ((g) << 8) | ((r) << 16)) | ((a) << 24)
Definition: fs_base_r.h:145
FS_RESULT FSPDF_Doc_GetTrailer(FSCRT_DOCUMENT document, FSPDF_OBJECT *trailer)
Get the PDF document trailer dictionary.
FSCRT_BSTR appID
Application identity to indicate applications to open this wrapper data.
Definition: fpdf_document_r.h:976
Structure for byte string.
Definition: fs_base_r.h:611
FS_RESULT FSPDF_Doc_CountPages(FSCRT_DOCUMENT document, FS_INT32 *count)
Get page count in document.
FS_RESULT FSPDF_Doc_DoJavaScriptAction(FSCRT_DOCUMENT document, FS_INT32 trigger)
Perform the document javascript which is specified by the trigger.
Structure for wrapper data.
Definition: fpdf_document_r.h:969
FS_RESULT FSPDF_Bookmark_IsFirstChild(FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL *isFirstChild)
Determine whether a bookmark iterator is the first child of its parent or not.
FS_RESULT FSPDF_Bookmark_MoveToFirstChild(FSPDF_BOOKMARK_ITERATOR iterator)
Move a bookmark iterator to its first child if existing.
FS_DWORD actionHandleSize
The size of this structure.
Definition: fpdf_document_r.h:1298
FS_RESULT FSPDF_Doc_GetPasswordType(FSCRT_DOCUMENT document, FS_INT32 *type)
Get current password type.
Structure for array.
Definition: fs_base_r.h:813
FS_RESULT FSPDF_Bookmark_ReleasePos(FSPDF_BOOKMARKPOS pos)
Release a bookmark position handle.
FS_ARGB color
Color used for displaying title. Format:0xAARRGGBB and alpha component is omitted.
Definition: fpdf_document_r.h:2202
FS_RESULT FSPDF_Doc_GetEncryptionType(FSCRT_DOCUMENT document, FS_INT32 *type)
Get current encryption type.
FS_RESULT FSPDF_Bookmark_MoveToPrevSibling(FSPDF_BOOKMARK_ITERATOR iterator)
Move a bookmark iterator to its previous sibling if existing.
FS_RESULT FSPDF_Doc_StartReLoad(FSCRT_DOCUMENT document, FSCRT_FILE file, const FSCRT_BSTR *password, FSCRT_PROGRESS *progress)
Reload PDF file.
FS_RESULT FSPDF_Doc_GetEncryptionSubFilter(FSCRT_DOCUMENT document, FSCRT_BSTR *subFilter)
Get encryption sub-filter value.
FS_INT32 version
Wrapper version.
Definition: fpdf_document_r.h:972
FS_RESULT FSPDF_Metadata_GetStringArray(FSCRT_DOCUMENT document, const FSCRT_BSTR *key, FSCRT_ARRAY *stringArray)
Get an UTF-8 string array value from metadata.
FS_RESULT FSPDF_ViewerPref_GetUIVisibility(FSCRT_DOCUMENT document, const FSCRT_BSTR *uiItem, FS_BOOL *uiVisible)
Get UI visibility status from viewer preferences.
FS_RESULT FSPDF_Metadata_GetDateTime(FSCRT_DOCUMENT document, const FSCRT_BSTR *key, FSCRT_DATETIMEZONE *dt)
Get a date and time value from metadata.
FS_RESULT FSPDF_Doc_Close(FSCRT_DOCUMENT document)
Close a PDF document.
int FS_RESULT
Result code for functions in Foxit PDF SDK.
Definition: fs_base_r.h:160
FS_RESULT FSPDF_Doc_GetFontByIndex(FSCRT_DOCUMENT document, FS_INT32 index, FSCRT_FONT *font)
Get the specific PDF font in the document.
FS_RESULT FSPDF_ViewerPref_GetPrintRanges(FSCRT_DOCUMENT document, FS_INT32 *pageRanges, FS_INT32 *count)
Get page ranges which allowed to print.
FS_RESULT FSPDF_Bookmark_MoveToPos(FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKPOS newPos)
Move a bookmark iterator to a specific position.
FS_RESULT FSPDF_Doc_CountActions(FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 *count)
Get the count of document trigger actions.
FS_RESULT FSPDF_Doc_GetPage(FSCRT_DOCUMENT document, FS_INT32 index, FSCRT_PAGE *page)
Get a page object.
FS_RESULT FSPDF_Doc_GetWrapperData(FSCRT_DOCUMENT document, FSPDF_WRAPPERDATA *wrapperData)
Get wrapper data.

Foxit Corporation