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 /* Metadata key category macros */
220 /*******************************************************************************/
221 #ifndef _FSPDF_DEF_MACRO_METADATAKEYTYPE_
222 #define _FSPDF_DEF_MACRO_METADATAKEYTYPE_
223 
230 #define FSPDF_METADATAKEYCATEGORY_ALL 0
231 
232 #define FSPDF_METADATAKEYCATEGORY_STANDARD 1
233 
234 #define FSPDF_METADATAKEYCATEGORY_CUSTOM 2
235 
237 #endif /* _FSPDF_DEF_MACRO_METADATAKEYTYPE_ */
238 
239 /*******************************************************************************/
240 /* PDF document load or reload */
241 /*******************************************************************************/
279 FS_RESULT FSPDF_Doc_StartLoad(FSCRT_FILE file, const FSCRT_BSTR* password, FSCRT_DOCUMENT* document, FSCRT_PROGRESS* progress);
280 
321 FS_RESULT FSPDF_Doc_StartLoadWithFlag(FSCRT_FILE file, const FSCRT_BSTR* password, FS_DWORD flag, FSCRT_DOCUMENT* document, FSCRT_PROGRESS* progress);
322 
357 FS_RESULT FSPDF_Doc_StartReLoad(FSCRT_DOCUMENT document, FSCRT_FILE file, const FSCRT_BSTR* password, FSCRT_PROGRESS* progress);
358 
383 FS_RESULT FSPDF_Doc_Close(FSCRT_DOCUMENT document);
384 
385 /*******************************************************************************/
386 /* Document objects */
387 /* */
388 /* Catalog, trailer, encrypt and document info dictionary */
389 /*******************************************************************************/
420 FS_RESULT FSPDF_Doc_GetCatalog(FSCRT_DOCUMENT document, FSPDF_OBJECT* object);
421 
453 FS_RESULT FSPDF_Doc_GetTrailer(FSCRT_DOCUMENT document, FSPDF_OBJECT* trailer);
454 
485 FS_RESULT FSPDF_Doc_GetInfoDict(FSCRT_DOCUMENT document, FSPDF_OBJECT* object);
486 
517 FS_RESULT FSPDF_Doc_GetEncryptDict(FSCRT_DOCUMENT document, FSPDF_OBJECT* object);
518 
519 /*******************************************************************************/
520 /* Access PDF document properties */
521 /*******************************************************************************/
552 FS_RESULT FSPDF_Doc_GetPasswordType(FSCRT_DOCUMENT document, FS_INT32* type);
553 
586 FS_RESULT FSPDF_Doc_GetEncryptionType(FSCRT_DOCUMENT document, FS_INT32* type);
587 
621 FS_RESULT FSPDF_Doc_GetEncryptionFilter(FSCRT_DOCUMENT document, FSCRT_BSTR* filter);
622 
653 FS_RESULT FSPDF_Doc_GetEncryptionSubFilter(FSCRT_DOCUMENT document, FSCRT_BSTR* subFilter);
654 
687 FS_RESULT FSPDF_Doc_GetEncryptionParam(FSCRT_DOCUMENT document, const FSCRT_BSTR* key, FSCRT_BSTR* value);
688 
715 FS_RESULT FSPDF_Doc_GetUserPermissions(FSCRT_DOCUMENT document, FS_DWORD* permissions);
716 
745 FS_RESULT FSPDF_Doc_GetDisplayMode(FSCRT_DOCUMENT document, FS_INT32* displayMode);
746 
771 FS_RESULT FSPDF_Doc_GetFileVersion(FSCRT_DOCUMENT document, FS_INT32* version);
772 
797 FS_RESULT FSPDF_Doc_IsModified(FSCRT_DOCUMENT document, FS_BOOL* isModified);
798 
823 FS_RESULT FSPDF_Doc_IsPortfolio(FSCRT_DOCUMENT document, FS_BOOL* isPortfolio);
824 
825 /*******************************************************************************/
826 /* Get PDF page object */
827 /*******************************************************************************/
852 FS_RESULT FSPDF_Doc_CountPages(FSCRT_DOCUMENT document, FS_INT32* count);
853 
883 FS_RESULT FSPDF_Doc_GetPage(FSCRT_DOCUMENT document, FS_INT32 index, FSCRT_PAGE* page);
884 
885 #ifndef _FSPDF_DEF_STRUCTURE_ENUMPAGEINFOHANDLER_
886 #define _FSPDF_DEF_STRUCTURE_ENUMPAGEINFOHANDLER_
887 
894 typedef struct _FSPDF_ENUMPAGEINFOHANDLER
895 {
900 
907 
908  /*
909  * @brief Enumerate page size for each PDF page.
910  *
911  * @details Foxit SDK calls this function to enumerate page size for each page, and the application can get page size quickly
912  * from the parameter <i>pageWidth</i> and <i>pageHeight</i>, with <i>pageIndex</i> in this callback function.<br>
913  * 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.
914  *
915  * @param[in] clientData Pointer to user-defined data.
916  * @param[in] pageIndex Index of a PDF page, starting from 0.
917  * @param[in] pageWidth Width of a PDF page.
918  * @param[in] pageHeight Height of a PDF page.
919  *
920  * @return ::FSCRT_ERRCODE_SUCCESS for success.<br>
921  * ::FSCRT_ERRCODE_UNRECOVERABLE if function finds an unrecoverable error internally.<br>
922  * For more error codes, please refer to macro definitions {@link FSCRT_ERRCODE_SUCCESS FSCRT_ERRCODE_XXX}.
923  */
924  FS_RESULT (*EnumPageSize)(FS_LPVOID clientData, FS_INT32 pageIndex, FS_FLOAT pageWidth, FS_FLOAT pageHeight);
925 
926  /*
927  * @brief Enumerate page rotation for each PDF page.
928  *
929  * @details Foxit SDK calls this function to enumerate page rotation for each page, and the application can get page rotation quickly
930  * from the parameter <i>pageRotation</i>, with <i>pageIndex</i> in this callback function.<br>
931  * 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.
932  *
933  * @param[in] clientData Pointer to user-defined data.
934  * @param[in] pageIndex Index of a PDF page, starting from 0.
935  * @param[in] pageRotation Rotation of a PDF page.
936  * Please refer to macro definitions {@link FSCRT_PAGEROTATION_0 FSCRT_PAGEROTATION_XXX} and this should be one of these macros.
937  *
938  * @return ::FSCRT_ERRCODE_SUCCESS for success.<br>
939  * ::FSCRT_ERRCODE_UNRECOVERABLE if function finds an unrecoverable error internally.<br>
940  * For more error codes, please refer to macro definitions {@link FSCRT_ERRCODE_SUCCESS FSCRT_ERRCODE_XXX}.
941  */
942  FS_RESULT (*EnumPageRotation)(FS_LPVOID clientData, FS_INT32 pageIndex, FS_INT32 pageRotation);
944 
945 #endif //_FSPDF_DEF_STRUCTURE_ENUMPAGEINFOHANDLER_
946 
975 FS_RESULT FSPDF_Doc_EnumPagesInfo(FSCRT_DOCUMENT document, FSPDF_ENUMPAGEINFOHANDLER* enumHandler);
976 
977 /*******************************************************************************/
978 /* Access PDF Wrapper */
979 /*******************************************************************************/
980 #ifndef _FSPDF_DEF_STRUCTURE_WRAPPERDATA_
981 #define _FSPDF_DEF_STRUCTURE_WRAPPERDATA_
982 
988 typedef struct _FSPDF_WRAPPERDATA
989 {
1000 
1002 
1003 #endif /* _FSPDF_DEF_STRUCTURE_WRAPPERDATA_ */
1004 
1028 
1052 
1086 FS_RESULT FSPDF_Doc_IsWrapper(FSCRT_DOCUMENT document, FS_BOOL* isWrapper);
1087 
1120 FS_RESULT FSPDF_Doc_GetWrapperOffset(FSCRT_DOCUMENT document, FSCRT_FILESIZE* offset);
1121 
1153 FS_RESULT FSPDF_Doc_GetWrapperData(FSCRT_DOCUMENT document, FSPDF_WRAPPERDATA* wrapperData);
1154 
1155 
1156 /*******************************************************************************/
1157 /* Document trigger actions */
1158 /*******************************************************************************/
1186 FS_RESULT FSPDF_Doc_CountActions(FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32* count);
1187 
1218 FS_RESULT FSPDF_Doc_GetAction(FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index, FSPDF_ACTIONDATA* actionData);
1219 
1220 
1221 /*******************************************************************************/
1222 /* PDF action handler */
1223 /*******************************************************************************/
1224 
1225 #ifndef _FSPDF_DEF_STRUCTURE_IDENTITYPROPERTIES_
1226 #define _FSPDF_DEF_STRUCTURE_IDENTITYPROPERTIES_
1227 
1229 typedef struct _FSPDF_IDENTITYPROPERTIES
1230 {
1240 
1241 #endif /* _FSPDF_IDENTITYPROPERTIES */
1242 
1243 #ifndef _FSPDF_DEF_STRUCTURE_MENULIST_
1244 #define _FSPDF_DEF_STRUCTURE_MENULIST_
1245 
1247 typedef struct _FSPDF_MENULIST
1248 {
1254 
1255 #endif /* _FSPDF_MENULIST */
1256 
1257 #ifndef _FSPDF_DEF_MACRO_APPINFO_
1258 #define _FSPDF_DEF_MACRO_APPINFO_
1259 
1265 #define FSPDF_APPINFOTYPE_FORMSVERSION 0x0
1266 
1268 #define FSPDF_APPINFOTYPE_VIEWERTYPE 0x1
1269 
1271 #define FSPDF_APPINFOTYPE_VIEWERVARIATION 0x2
1272 
1274 #define FSPDF_APPINFOTYPE_VIEWERVERSION 0x3
1275 
1277 #define FSPDF_APPINFOTYPE_APPVERSION 0x4
1278 
1280 #endif /* _FSPDF_DEF_MACRO_APPINFO_ */
1281 
1282 #ifndef _FSPDF_DEF_MACRO_MAILTYPE_
1283 #define _FSPDF_DEF_MACRO_MAILTYPE_
1284 
1290 #define FSPDF_MAILTYPE_DOC 0
1291 
1293 #define FSPDF_MAILTYPE_FORM 1
1294 
1296 #define FSPDF_MAILTYPE_MSG 2
1297 
1299 #endif /* _FSPDF_DEF_MACRO_MAILTYPE_ */
1300 
1301 #ifndef _FSPDF_DEF_HANDLER_JAVASCRIPT_ACTION_
1302 #define _FSPDF_DEF_HANDLER_JAVASCRIPT_ACTION_
1303 
1310 typedef struct _FSPDF_JAVASCRIPTACTION_HANDLER
1311 {
1318 
1325 
1337  FS_RESULT (*Release)(FS_LPVOID clientData);
1338 
1354  FS_RESULT (*InvalidateRect)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 pageIndex, FSCRT_RECTF* pdfRect);
1355 
1367  FS_RESULT (*GetCurrentPageIndex)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32* pageIndex);
1368 
1379  FS_RESULT (*SetCurrentPageIndex)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 pageIndex);
1380 
1393  FS_RESULT (*GetRotation)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 pageIndex, FS_INT32* rotation);
1394 
1407  FS_RESULT (*ExecuteNamedAction)(FS_LPVOID clientData, FSCRT_DOCUMENT document, const FSCRT_BSTR* namedAction);
1408 
1419  FS_RESULT (*SetChangeMark)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL changeMark);
1420 
1431  FS_RESULT (*GetChangeMark)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL* changeMark);
1432 
1457  FS_RESULT (*GetOpenedDocs)(FS_LPVOID clientData, FSCRT_DOCUMENT* docs, FS_INT32* count);
1458 
1490  FS_RESULT (*Alert)(FS_LPVOID clientData, const FSCRT_BSTR* msg, const FSCRT_BSTR* title, FS_INT32 type, FS_INT32 icon, FS_INT32* retCode);
1491 
1508  FS_RESULT (*Beep)(FS_LPVOID clientData, FS_INT32 type);
1509 
1529  FS_RESULT (*Response)(FS_LPVOID clientData, const FSCRT_BSTR* question, const FSCRT_BSTR* title, const FSCRT_BSTR* defaultValue,
1530  const FSCRT_BSTR* label, FS_BOOL isPassword, FSCRT_BSTR* response);
1531 
1543  FS_RESULT (*GetFilePath)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FSCRT_BSTR* filePath);
1544 
1567  FS_RESULT (*Mail)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL bUI, const FSCRT_BSTR* To,
1568  const FSCRT_BSTR* Subject, const FSCRT_BSTR* CC, const FSCRT_BSTR* BCC, const FSCRT_BSTR* Msg);
1569 
1588  FS_RESULT (*Print)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL isUI, FS_INT32 start, FS_INT32 end, FS_BOOL isSilent ,
1589  FS_BOOL isShrinkToFit, FS_BOOL isPrintAsImage, FS_BOOL isReverse, FS_BOOL isAnnotations);
1590 
1603  FS_RESULT (*SubmitForm)(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_LPVOID formData, FS_DWORD length, const FSCRT_BSTR* URL);
1604 
1614  FS_RESULT (*LaunchURL)(FS_LPVOID clientData, const FSCRT_BSTR* URL);
1615 
1628  FS_RESULT (*BrowseFile)(FS_LPVOID clientData, FSCRT_BSTR* filePath);
1629 
1640  FS_RESULT (*GetLanguage)(FS_LPVOID clientData, FS_INT32* language);
1641 
1642  /*
1643  * @brief Optional callback function to get identity properties of the current user.
1644  *
1645  * @param[in] clientData The user-supplied data.
1646  * @param[out] identityProperties Pointer to a ::FSPDF_IDENTITYPROPERTIES structure that receives the identity properties.
1647  *
1648  * @return ::FSCRT_ERRCODE_SUCCESS for success.<br>
1649  * For more error codes, please refer to macro definitions {@link FSCRT_ERRCODE_SUCCESS FSCRT_ERRCODE_XXX}.
1650  */
1651  FS_RESULT (*GetIdentityProperties)(FS_LPVOID clientData, FSPDF_IDENTITYPROPERTIES* identityProperties);
1652 
1667  FS_RESULT (*PopupMenu)(FS_LPVOID clientData, const FSPDF_MENULIST* menus, FS_INT32 count, FSCRT_BSTR* seletedMenu);
1668 
1682  FS_RESULT (*GetAppInfo)(FS_LPVOID clientData, FS_INT32 type, FSCRT_BSTR* info);
1683 
1716  FS_RESULT (*MailData)(FS_LPVOID clientData, FS_LPVOID data, FS_DWORD dataType, FS_BOOL bUI, const FSCRT_BSTR* To,
1717  const FSCRT_BSTR* Subject, const FSCRT_BSTR* CC, const FSCRT_BSTR* BCC, const FSCRT_BSTR* Msg);
1718 
1720 
1721 #endif /* _FSPDF_DEF_HANDLER_JAVASCRIPT_ACTION_ */
1722 
1746 FS_RESULT FSPDF_Doc_SetJavaScriptActionHandler(FSCRT_DOCUMENT document, FSPDF_JAVASCRIPTACTION_HANDLER* actionHandler);
1747 
1770 FS_RESULT FSPDF_Doc_InitiateJavaScript(FSCRT_DOCUMENT document);
1771 
1796 FS_RESULT FSPDF_Doc_DoJavaScriptAction(FSCRT_DOCUMENT document, FS_INT32 trigger);
1797 
1825 FS_RESULT FSPDF_Doc_GetJSActionByName(FSCRT_DOCUMENT document, const FSCRT_BSTR* name, FSPDF_ACTIONDATA* actionData);
1826 
1827 /*******************************************************************************/
1828 /* PDF page label */
1829 /*******************************************************************************/
1830 
1831 #ifndef _FSPDF_DEF_MACRO_PAGELABEL_STYLE_
1832 #define _FSPDF_DEF_MACRO_PAGELABEL_STYLE_
1833 
1840 #define FSPDF_PAGELABEL_STYLE_None 0
1841 
1842 #define FSPDF_PAGELABEL_STYLE_D 1
1843 
1844 #define FSPDF_PAGELABEL_STYLE_R 2
1845 
1846 #define FSPDF_PAGELABEL_STYLE_r 3
1847 
1848 #define FSPDF_PAGELABEL_STYLE_A 4
1849 
1850 #define FSPDF_PAGELABEL_STYLE_a 5
1851 
1853 #endif /* _FSPDF_DEF_MACRO_PAGELABEL_STYLE_ */
1854 
1885 FS_RESULT FSPDF_Doc_PageLabelToPageIndex(FSCRT_DOCUMENT document, FS_BOOL noCase, const FSCRT_BSTR* pageLabel, FS_INT32* pageIndex);
1886 
1918 FS_RESULT FSPDF_Doc_PageIndexToPageLabel(FSCRT_DOCUMENT document, FS_INT32 pageIndex, FSCRT_BSTR* pageLabel);
1919 
1947 FS_RESULT FSPDF_PageLabels_CountRanges(FSCRT_DOCUMENT document, FS_INT32* count);
1948 
1989 FS_RESULT FSPDF_PageLabels_GetRangeInfo(FSCRT_DOCUMENT document, FS_INT32 rangeIndex, FS_INT32* start, FS_INT32* style, FSCRT_BSTR* prefix, FS_INT32* st);
1990 
1991 /*******************************************************************************/
1992 /* Access PDF metadata */
1993 /*******************************************************************************/
2044 FS_RESULT FSPDF_Metadata_GetString(FSCRT_DOCUMENT document, const FSCRT_BSTR* key, FSCRT_BSTR* string);
2045 
2096 FS_RESULT FSPDF_Metadata_GetStringArray(FSCRT_DOCUMENT document, const FSCRT_BSTR* key, FSCRT_ARRAY* stringArray);
2097 
2138 FS_RESULT FSPDF_Metadata_GetDateTime(FSCRT_DOCUMENT document, const FSCRT_BSTR* key, FSCRT_DATETIMEZONE* dt);
2139 
2169 FS_RESULT FSPDF_Metadata_GetKeys(FSCRT_DOCUMENT document, FS_INT32 filter, FSCRT_ARRAY* keyArray);
2170 
2171 /*******************************************************************************/
2172 /* Access PDF bookmarks */
2173 /*******************************************************************************/
2174 #ifndef _FSPDF_DEF_HANDLE_BOOKMARK_ITERATOR_
2175 #define _FSPDF_DEF_HANDLE_BOOKMARK_ITERATOR_
2176 
2178 FSCRT_DEFINEHANDLE(FSPDF_BOOKMARK_ITERATOR);
2179 
2180 #endif /* _FSPDF_DEF_HANDLE_BOOKMARK_ITERATOR_ */
2181 
2182 #ifndef _FSPDF_DEF_HANDLE_BOOKMARK_POS_
2183 #define _FSPDF_DEF_HANDLE_BOOKMARK_POS_
2184 
2186 FSCRT_DEFINEHANDLE(FSPDF_BOOKMARKPOS);
2187 
2188 #endif /* _FSPDF_DEF_HANDLE_BOOKMARK_POS_ */
2189 
2190 #ifndef _FSPDF_DEF_MACRO_BOOKMARKSTATUS_
2191 #define _FSPDF_DEF_MACRO_BOOKMARKSTATUS_
2192 
2200 #define FSPDF_BOOKMARKSTATUS_NORMAL 0
2201 
2202 #define FSPDF_BOOKMARKSTATUS_BOLD 1
2203 
2204 #define FSPDF_BOOKMARKSTATUS_ITALIC 2
2205 
2210 #define FSPDF_BOOKMARKSTATUS_EXPANDED 4
2211 
2213 #endif /* _FSPDF_DEF_MACRO_BOOKMARKSTATUS_ */
2214 
2215 #ifndef _FSPDF_DEF_MACRO_BOOKMARKPOS_
2216 #define _FSPDF_DEF_MACRO_BOOKMARKPOS_
2217 
2225 #define FSPDF_BOOKMARKPOS_FIRSTCHILD 0
2226 
2227 #define FSPDF_BOOKMARKPOS_LASTCHILD 1
2228 
2229 #define FSPDF_BOOKMARKPOS_PREVIOUS 2
2230 
2231 #define FSPDF_BOOKMARKPOS_NEXT 3
2232 
2233 #define FSPDF_BOOKMARKPOS_FIRSTSIBLING 4
2234 
2235 #define FSPDF_BOOKMARKPOS_LASTSIBLING 5
2236 
2238 #endif /* _FSPDF_DEF_MACRO_BOOKMARKPOS_ */
2239 
2240 #ifndef _FSPDF_DEF_STRUCTURE_BOOKMARKDATA_
2241 #define _FSPDF_DEF_STRUCTURE_BOOKMARKDATA_
2242 
2248 typedef struct _FSPDF_BOOKMARKDATA_
2249 {
2261 
2262 #endif /* _FSPDF_DEF_STRUCTURE_BOOKMARKDATA_ */
2263 
2287 
2312 
2341 FS_RESULT FSPDF_Doc_CreateBookmarkIterator(FSCRT_DOCUMENT document, FSPDF_BOOKMARK_ITERATOR* iterator);
2342 
2366 FS_RESULT FSPDF_Bookmark_GetPos(FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKPOS* pos);
2367 
2395 FS_RESULT FSPDF_Bookmark_CloneIterator(FSPDF_BOOKMARK_ITERATOR srcIterator, FSPDF_BOOKMARK_ITERATOR* clonedIterator);
2396 
2416 FS_RESULT FSPDF_Bookmark_ReleaseIterator(FSPDF_BOOKMARK_ITERATOR iterator);
2417 
2437 FS_RESULT FSPDF_Bookmark_ReleasePos(FSPDF_BOOKMARKPOS pos);
2438 
2458 FS_RESULT FSPDF_Bookmark_MoveToRoot(FSPDF_BOOKMARK_ITERATOR iterator);
2459 
2485 FS_RESULT FSPDF_Bookmark_IsRoot(FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL* isRoot);
2486 
2507 FS_RESULT FSPDF_Bookmark_MoveToParent(FSPDF_BOOKMARK_ITERATOR iterator);
2508 
2529 FS_RESULT FSPDF_Bookmark_MoveToFirstChild(FSPDF_BOOKMARK_ITERATOR iterator);
2530 
2551 FS_RESULT FSPDF_Bookmark_MoveToNextSibling(FSPDF_BOOKMARK_ITERATOR iterator);
2552 
2573 FS_RESULT FSPDF_Bookmark_MoveToPrevSibling(FSPDF_BOOKMARK_ITERATOR iterator);
2574 
2597 FS_RESULT FSPDF_Bookmark_MoveToPos(FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKPOS newPos);
2598 
2624 FS_RESULT FSPDF_Bookmark_HasChild(FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL* hasChild);
2625 
2651 FS_RESULT FSPDF_Bookmark_IsFirstChild(FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL* isFirstChild);
2652 
2678 FS_RESULT FSPDF_Bookmark_IsLastChild(FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL* isLastChild);
2679 
2701 FS_RESULT FSPDF_Bookmark_GetData(FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKDATA* bmData);
2702 
2725 FS_RESULT FSPDF_Bookmark_CountActions(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32* count);
2726 
2751 FS_RESULT FSPDF_Bookmark_GetAction(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index, FSPDF_ACTIONDATA* actionData);
2752 
2753 /*******************************************************************************/
2754 /* Access PDF viewer preferences */
2755 /*******************************************************************************/
2756 #ifndef _FSPDF_DEF_MACRO_READDIREC_
2757 #define _FSPDF_DEF_MACRO_READDIREC_
2758 
2762 #define FSPDF_READDIRECT_L2R 0
2763 
2764 #define FSPDF_READDIRECT_R2L 1
2765 
2767 #endif /* _FSPDF_DEF_MACRO_READDIREC_ */
2768 
2808 FS_RESULT FSPDF_ViewerPref_GetUIVisibility(FSCRT_DOCUMENT document, const FSCRT_BSTR* uiItem, FS_BOOL* uiVisible);
2809 
2845 FS_RESULT FSPDF_ViewerPref_GetNonFullScreenPageMode(FSCRT_DOCUMENT document, FS_INT32* displayMode);
2846 
2877 FS_RESULT FSPDF_ViewerPref_GetReadingDirection(FSCRT_DOCUMENT document, FS_INT32* direction);
2878 
2917 FS_RESULT FSPDF_ViewerPref_GetAreaType(FSCRT_DOCUMENT document, const FSCRT_BSTR* boxItem, FS_INT32* boxType);
2918 
2955 FS_RESULT FSPDF_ViewerPref_GetPrintScale(FSCRT_DOCUMENT document, FSCRT_BSTR* printScale);
2956 
2986 FS_RESULT FSPDF_ViewerPref_GetPrintCopies(FSCRT_DOCUMENT document, FS_INT32* copies);
2987 
3024 FS_RESULT FSPDF_ViewerPref_GetPrintRanges(FSCRT_DOCUMENT document, FS_INT32* pageRanges, FS_INT32* count);
3025 
3026 /*******************************************************************************/
3027 /* PDF attachments */
3028 /*******************************************************************************/
3029 #ifndef _FSPDF_DEF_HANDLE_ATTACHMENTS_
3030 #define _FSPDF_DEF_HANDLE_ATTACHMENTS_
3031 
3033 FSCRT_DEFINEHANDLE(FSPDF_ATTACHMENTS);
3034 
3035 #endif /* _FSPDF_DEF_HANDLE_ATTACHMENTS_ */
3036 
3063 FS_RESULT FSPDF_Doc_LoadAttachments(FSCRT_DOCUMENT document, FSPDF_ATTACHMENTS* attachments);
3064 
3084 FS_RESULT FSPDF_Attachments_Release(FSPDF_ATTACHMENTS attachments);
3085 
3106 FS_RESULT FSPDF_Attachments_CountAttachment(FSPDF_ATTACHMENTS attachments, FS_INT32* count);
3107 
3131 FS_RESULT FSPDF_Attachments_GetAttachment(FSPDF_ATTACHMENTS attachments, FS_INT32 index, FSPDF_ATTACHMENT* attachment);
3132 
3133 /*******************************************************************************/
3134 /* PDF Fonts */
3135 /*******************************************************************************/
3158 FS_RESULT FSPDF_Doc_CountFonts(FSCRT_DOCUMENT document, FS_INT32* count);
3159 
3186 FS_RESULT FSPDF_Doc_GetFontByIndex(FSCRT_DOCUMENT document, FS_INT32 index, FSCRT_FONT* font);
3187 
3188 /*******************************************************************************/
3189 /* Memory optimition */
3190 /*******************************************************************************/
3214 FS_RESULT FSPDF_Doc_ClearCache(FSCRT_DOCUMENT document);
3215 
3216 
3217 #ifdef __cplusplus
3218 };
3219 #endif
3220  /* group FPDFDOCUMENT */
3222 
3223 #endif /* _FSPDF_DOCUMENT_R_H_ */
3224 
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:1229
Structure for rectangle, in float.
Definition: fs_base_r.h:2080
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:900
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:2248
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:2251
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:1324
FSCRT_BSTR corporation
The corporation name that the user has entered in the Identity preferences panel. ...
Definition: fpdf_document_r.h:1232
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:2020
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:1247
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:906
FSCRT_BSTR email
The email address that the user has entered in the Identity preferences panel.
Definition: fpdf_document_r.h:1234
FSCRT_BSTR name
The title of menu.
Definition: fpdf_document_r.h:1252
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:894
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:993
FSCRT_BSTR loginName
The login name as registered by the operating system.
Definition: fpdf_document_r.h:1236
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_Metadata_GetKeys(FSCRT_DOCUMENT document, FS_INT32 filter, FSCRT_ARRAY *keyArray)
Get keys from metadata(both Info dictionary and XML) according to filter.
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:999
Structure for action handler information.
Definition: fpdf_document_r.h:1310
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:899
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:1238
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:1250
FSCRT_BSTR uri
URI for consumers to access for more information.
Definition: fpdf_document_r.h:997
FS_DWORD status
Current status of bookmark.
Definition: fpdf_document_r.h:2259
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:995
Structure for byte string.
Definition: fs_base_r.h:613
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:988
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:1317
FS_RESULT FSPDF_Doc_GetPasswordType(FSCRT_DOCUMENT document, FS_INT32 *type)
Get current password type.
Structure for array.
Definition: fs_base_r.h:815
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:2253
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:991
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