fpdf_document_w.h
Go to the documentation of this file.
1 
28 #ifndef _FSPDF_DOCUMENT_W_H_
29 #define _FSPDF_DOCUMENT_W_H_
30 
118 #ifdef __cplusplus
119 extern "C" {
120 #endif
121 
122 /*******************************************************************************/
123 /* Document level macros */
124 /*******************************************************************************/
125 #ifndef _FSPDF_DEF_MACRO_SAVEAS_
126 #define _FSPDF_DEF_MACRO_SAVEAS_
127 
134 #define FSPDF_SAVEFLAG_INCREMENTAL 0x1
135 
136 #define FSPDF_SAVEFLAG_NOORIGINAL 0x2
137 
138 #define FSPDF_SAVEFLAG_REMOVESECURITY 0x4
139 
140 #define FSPDF_SAVEFLAG_OBJECTSTREAM 0x8
141 
142 #define FSPDF_SAVEFLAG_OPTIMIZE 0x10
143 
157 #define FSPDF_SAVEFLAG_INCREMENTONLY 0x20
158 
163 #define FSPDF_SAVEFLAG_LINEARIZED 0x40
164 
166 #endif /* _FSPDF_DEF_MACRO_SAVEAS_ */
167 
168 #ifndef _FSPDF_DEF_MACRO_IMPORTFLAG_
169 #define _FSPDF_DEF_MACRO_IMPORTFLAG_
170 
177 #define FSPDF_IMPORTFLAG_NORMAL 0x00
178 
179 #define FSPDF_IMPORTFLAG_WITHLAYERS 0x01
180 
181 #define FSPDF_IMPORTFLAG_SHARESTREAM 0x02
182 
184 #endif /* _FSPDF_DEF_MACRO_IMPORTFLAG_ */
185 
186 
187 
188 /*******************************************************************************/
189 /* Create PDF document or import pages from another one */
190 /*******************************************************************************/
214 FS_RESULT FSPDF_Doc_Create(FSCRT_DOCUMENT* document);
215 
265 FS_RESULT FSPDF_Doc_StartImportPages(FSCRT_DOCUMENT dstDoc, FS_INT32 startIndex,
266  FSCRT_DOCUMENT srcDoc, const FS_INT32* pageRanges, FS_INT32 count,
267  FSCRT_PROGRESS* importProgress);
268 
320 FS_RESULT FSPDF_Doc_StartImportPagesWithLayers(FSCRT_DOCUMENT dstDoc, FS_INT32 startIndex,
321  FSCRT_DOCUMENT srcDoc, const FSCRT_BSTR* layerName, const FS_INT32* pageRanges, FS_INT32 count,
322  FSCRT_PROGRESS* importProgress);
323 
386 FS_RESULT FSPDF_Doc_StartImportPagesFromFileName(FSCRT_DOCUMENT dstDoc, FS_INT32 startIndex,
387  const FSCRT_BSTR* srcFileName, const FSCRT_BSTR* password,
388  const FSCRT_BSTR* layerName, const FS_INT32* pageRanges, FS_INT32 count,
389  FS_INT32 flags, FSCRT_PROGRESS* importProgress);
390 
391 /*******************************************************************************/
392 /* Save PDF document */
393 /*******************************************************************************/
448 FS_RESULT FSPDF_Doc_StartSaveToFile(FSCRT_DOCUMENT document, FSCRT_FILE file, FS_INT32 flag, FSCRT_PROGRESS* saveProgress);
449 
497 FS_RESULT FSPDF_Doc_SaveAsWrapperFile(FSCRT_DOCUMENT wrapperDoc, FSCRT_FILE file, const FSPDF_WRAPPERDATA* wrapperData,
498  FS_DWORD userPermissions, const FSCRT_BSTR* ownerPassword);
499 
500 /*******************************************************************************/
501 /* Document trigger actions */
502 /*******************************************************************************/
532 FS_RESULT FSPDF_Doc_SetAction(FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index, const FSPDF_ACTIONDATA* actionData);
533 
565 FS_RESULT FSPDF_Doc_InsertAction(FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index, const FSPDF_ACTIONDATA* actionData);
566 
595 FS_RESULT FSPDF_Doc_RemoveAction(FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index);
596 
623 FS_RESULT FSPDF_Doc_RemoveAllActions(FSCRT_DOCUMENT document, FS_INT32 trigger);
624 
652 FS_RESULT FSPDF_Doc_RemoveJSActionByName(FSCRT_DOCUMENT document, const FSCRT_BSTR *name);
653 
676 FS_RESULT FSPDF_Doc_SetFileVersion(FSCRT_DOCUMENT document, FS_INT32 version);
677 
702 FS_RESULT FSPDF_Doc_SetDisplayMode(FSCRT_DOCUMENT document, FS_INT32 displayMode);
703 
704 /*******************************************************************************/
705 /* PDF page label */
706 /*******************************************************************************/
707 
745 FS_RESULT FSPDF_PageLabels_SetRangeInfo(FSCRT_DOCUMENT document, FS_INT32 start, FS_INT32 style, const FSCRT_BSTR* prefix, FS_INT32 st);
746 
770 FS_RESULT FSPDF_PageLabels_RemoveAll(FSCRT_DOCUMENT document);
771 
772 /*******************************************************************************/
773 /* Access PDF metadata */
774 /*******************************************************************************/
817 FS_RESULT FSPDF_Metadata_SetString(FSCRT_DOCUMENT document, const FSCRT_BSTR* key, const FSCRT_BSTR* string);
818 
867 FS_RESULT FSPDF_Metadata_SetStringArray(FSCRT_DOCUMENT document, const FSCRT_BSTR* key, const FSCRT_BSTR* stringArray, const FS_INT32 count);
868 
904 FS_RESULT FSPDF_Metadata_SetDateTime(FSCRT_DOCUMENT document, const FSCRT_BSTR* key, const FSCRT_DATETIMEZONE* dt);
905 
933 FS_RESULT FSPDF_Metadata_DeleteKey(FSCRT_DOCUMENT document, const FSCRT_BSTR* key);
934 
935 /*******************************************************************************/
936 /* Access PDF bookmarks */
937 /*******************************************************************************/
959 FS_RESULT FSPDF_Bookmark_SetData(FSPDF_BOOKMARK_ITERATOR iterator, const FSPDF_BOOKMARKDATA* bmData);
960 
987 FS_RESULT FSPDF_Bookmark_Insert(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 pos, const FSPDF_BOOKMARKDATA* bmData);
988 
1021 FS_RESULT FSPDF_Bookmark_InsertAtPos(FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKPOS newParentPos, FS_INT32 childIndex);
1022 
1047 FS_RESULT FSPDF_Bookmark_Remove(FSPDF_BOOKMARK_ITERATOR iterator);
1048 
1073 FS_RESULT FSPDF_Bookmark_SetAction(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index, const FSPDF_ACTIONDATA* actionData);
1074 
1101 FS_RESULT FSPDF_Bookmark_InsertAction(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index, const FSPDF_ACTIONDATA* actionData);
1102 
1126 FS_RESULT FSPDF_Bookmark_RemoveAction(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index);
1127 
1149 FS_RESULT FSPDF_Bookmark_RemoveAllActions(FSPDF_BOOKMARK_ITERATOR iterator);
1150 
1179 FS_RESULT FSPDF_Bookmark_Update(FSPDF_BOOKMARK_ITERATOR iterator);
1180 
1181 /*******************************************************************************/
1182 /* Access PDF viewer preferences */
1183 /*******************************************************************************/
1184 
1223 FS_RESULT FSPDF_ViewerPref_SetUIVisibility(FSCRT_DOCUMENT document, const FSCRT_BSTR* uiItem, FS_BOOL uiVisible);
1224 
1257 FS_RESULT FSPDF_ViewerPref_SetNonFullScreenPageMode(FSCRT_DOCUMENT document, FS_INT32 displayMode);
1258 
1288 FS_RESULT FSPDF_ViewerPref_SetReadingDirection(FSCRT_DOCUMENT document, FS_INT32 direction);
1289 
1325 FS_RESULT FSPDF_ViewerPref_SetAreaType(FSCRT_DOCUMENT document, const FSCRT_BSTR* boxItem, FS_INT32 boxType);
1326 
1359 FS_RESULT FSPDF_ViewerPref_SetPrintScale(FSCRT_DOCUMENT document, const FSCRT_BSTR* printScale);
1360 
1390 FS_RESULT FSPDF_ViewerPref_SetPrintCopies(FSCRT_DOCUMENT document, FS_INT32 copies);
1391 
1421 FS_RESULT FSPDF_ViewerPref_SetPrintRanges(FSCRT_DOCUMENT document, const FS_INT32* pageRanges, FS_INT32 count);
1422 
1423 /*******************************************************************************/
1424 /* PDF attachments */
1425 /*******************************************************************************/
1451 FS_RESULT FSPDF_Attachments_InsertAttachment(FSPDF_ATTACHMENTS attachments, FS_INT32 index, FSPDF_ATTACHMENT attachment);
1452 
1477 FS_RESULT FSPDF_Attachments_RemoveAttachment(FSPDF_ATTACHMENTS attachments, FSPDF_ATTACHMENT attachment);
1478 
1479 /*******************************************************************************/
1480 /* PDF Fonts */
1481 /*******************************************************************************/
1523 FS_RESULT FSPDF_Doc_EmbedFont(FSCRT_DOCUMENT document, FSCRT_FONT font);
1524 
1525 #ifdef __cplusplus
1526 };
1527 #endif
1528  /* group FPDFDOCUMENT */
1530 
1531 #endif /* _FSPDF_DOCUMENT_W_H_ */
1532 
FS_RESULT FSPDF_Bookmark_SetAction(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index, const FSPDF_ACTIONDATA *actionData)
Set bookmark action.
FS_RESULT FSPDF_Doc_StartImportPages(FSCRT_DOCUMENT dstDoc, FS_INT32 startIndex, FSCRT_DOCUMENT srcDoc, const FS_INT32 *pageRanges, FS_INT32 count, FSCRT_PROGRESS *importProgress)
To start a progressive process of inserting a range of pages from a extra source document into the ta...
FS_RESULT FSPDF_Bookmark_RemoveAllActions(FSPDF_BOOKMARK_ITERATOR iterator)
Remove all bookmark actions.
FS_RESULT FSPDF_Doc_SaveAsWrapperFile(FSCRT_DOCUMENT wrapperDoc, FSCRT_FILE file, const FSPDF_WRAPPERDATA *wrapperData, FS_DWORD userPermissions, const FSCRT_BSTR *ownerPassword)
Save a PDF document as a wrapper file.
FS_RESULT FSPDF_Doc_RemoveJSActionByName(FSCRT_DOCUMENT document, const FSCRT_BSTR *name)
Remove a javascript action from the PDF document by the name of javascript action.
FS_RESULT FSPDF_Bookmark_InsertAtPos(FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKPOS newParentPos, FS_INT32 childIndex)
Insert a bookmark to be the child (with specific index) of another bookmark with specific position an...
FS_RESULT FSPDF_Doc_SetDisplayMode(FSCRT_DOCUMENT document, FS_INT32 displayMode)
Set display mode specified in PDF document.
FS_RESULT FSPDF_Doc_Create(FSCRT_DOCUMENT *document)
Create a new document object.
unsigned int FS_DWORD
32-bit unsigned integer.
Definition: fs_base_r.h:142
Structure for bookmark data.
Definition: fpdf_document_r.h:2248
FS_RESULT FSPDF_Attachments_InsertAttachment(FSPDF_ATTACHMENTS attachments, FS_INT32 index, FSPDF_ATTACHMENT attachment)
Insert an attachment.
FS_RESULT FSPDF_Bookmark_Update(FSPDF_BOOKMARK_ITERATOR iterator)
Update specific bookmark iterator object after structure of bookmark tree has been changed...
FS_RESULT FSPDF_Bookmark_SetData(FSPDF_BOOKMARK_ITERATOR iterator, const FSPDF_BOOKMARKDATA *bmData)
Set data to current bookmark positioned by parameter iterator.
FS_RESULT FSPDF_ViewerPref_SetUIVisibility(FSCRT_DOCUMENT document, const FSCRT_BSTR *uiItem, FS_BOOL uiVisible)
Set UI visibility in viewer preferences.
int FS_INT32
32-bit signed integer.
Definition: fs_base_r.h:175
Structure for date and time.
Definition: fs_base_r.h:2020
FS_RESULT FSPDF_PageLabels_RemoveAll(FSCRT_DOCUMENT document)
Delete all page labels in the PDF document.
FS_RESULT FSPDF_Bookmark_InsertAction(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index, const FSPDF_ACTIONDATA *actionData)
Insert bookmark action.
FS_RESULT FSPDF_ViewerPref_SetAreaType(FSCRT_DOCUMENT document, const FSCRT_BSTR *boxItem, FS_INT32 boxType)
Set the page box type in viewer preferences.
FS_RESULT FSPDF_Metadata_SetString(FSCRT_DOCUMENT document, const FSCRT_BSTR *key, const FSCRT_BSTR *string)
Set a UTF-8 string value to parameter key in metadata.
FS_RESULT FSPDF_Metadata_DeleteKey(FSCRT_DOCUMENT document, const FSCRT_BSTR *key)
Delete metadata key and value.
FS_RESULT FSPDF_Metadata_SetDateTime(FSCRT_DOCUMENT document, const FSCRT_BSTR *key, const FSCRT_DATETIMEZONE *dt)
Set a date value to parameter key in metadata.
Structure for an action data.
Definition: fpdf_base_r.h:841
FS_RESULT FSPDF_Doc_InsertAction(FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index, const FSPDF_ACTIONDATA *actionData)
Insert document trigger action.
FS_RESULT FSPDF_ViewerPref_SetReadingDirection(FSCRT_DOCUMENT document, FS_INT32 direction)
Set reading direction in viewer preferences.
FS_RESULT FSPDF_Metadata_SetStringArray(FSCRT_DOCUMENT document, const FSCRT_BSTR *key, const FSCRT_BSTR *stringArray, const FS_INT32 count)
Set an UTF-8 string array value to parameter key in metadata.
int FS_BOOL
Boolean type (This should be TRUE or FALSE).
Definition: fs_base_r.h:133
FS_RESULT FSPDF_ViewerPref_SetPrintScale(FSCRT_DOCUMENT document, const FSCRT_BSTR *printScale)
Set page scaling in viewer preferences.
FS_RESULT FSPDF_Attachments_RemoveAttachment(FSPDF_ATTACHMENTS attachments, FSPDF_ATTACHMENT attachment)
Remove an attachment.
FS_RESULT FSPDF_ViewerPref_SetPrintCopies(FSCRT_DOCUMENT document, FS_INT32 copies)
Set the number of copies to be printed.
FS_RESULT FSPDF_Doc_StartImportPagesFromFileName(FSCRT_DOCUMENT dstDoc, FS_INT32 startIndex, const FSCRT_BSTR *srcFileName, const FSCRT_BSTR *password, const FSCRT_BSTR *layerName, const FS_INT32 *pageRanges, FS_INT32 count, FS_INT32 flags, FSCRT_PROGRESS *importProgress)
To start a progressive process of inserting a range of pages from an extra source document which spec...
FS_RESULT FSPDF_Bookmark_Remove(FSPDF_BOOKMARK_ITERATOR iterator)
Remove the current bookmark item positioned by parameter iterator.
FS_RESULT FSPDF_ViewerPref_SetNonFullScreenPageMode(FSCRT_DOCUMENT document, FS_INT32 displayMode)
Set display mode for non full-screen mode in viewer preferences.
FS_RESULT FSPDF_Doc_RemoveAction(FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index)
Remove document trigger action.
FS_RESULT FSPDF_Doc_StartSaveToFile(FSCRT_DOCUMENT document, FSCRT_FILE file, FS_INT32 flag, FSCRT_PROGRESS *saveProgress)
Start saving a PDF document to another file in a progressive manner.
FS_RESULT FSPDF_Bookmark_RemoveAction(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index)
Remove a specific bookmark action.
FS_RESULT FSPDF_Doc_RemoveAllActions(FSCRT_DOCUMENT document, FS_INT32 trigger)
Remove all document trigger action.
Structure for byte string.
Definition: fs_base_r.h:613
FS_RESULT FSPDF_Doc_EmbedFont(FSCRT_DOCUMENT document, FSCRT_FONT font)
Embed a PDF font to the PDF document.
Structure for wrapper data.
Definition: fpdf_document_r.h:988
FS_RESULT FSPDF_Doc_SetFileVersion(FSCRT_DOCUMENT document, FS_INT32 version)
Specify the PDF file version which will be stored in PDF header section. This function does not check...
FS_RESULT FSPDF_Doc_StartImportPagesWithLayers(FSCRT_DOCUMENT dstDoc, FS_INT32 startIndex, FSCRT_DOCUMENT srcDoc, const FSCRT_BSTR *layerName, const FS_INT32 *pageRanges, FS_INT32 count, FSCRT_PROGRESS *importProgress)
To start a progressive process of inserting a range of pages from a extra source document with its la...
FS_RESULT FSPDF_Bookmark_Insert(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 pos, const FSPDF_BOOKMARKDATA *bmData)
Insert a new bookmark at parameter pos bookmark position and set the data.
FS_RESULT FSPDF_PageLabels_SetRangeInfo(FSCRT_DOCUMENT document, FS_INT32 start, FS_INT32 style, const FSCRT_BSTR *prefix, FS_INT32 st)
Set page labels of PDF pages with a specified range.
FS_RESULT FSPDF_Doc_SetAction(FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index, const FSPDF_ACTIONDATA *actionData)
Set document trigger action.
FS_RESULT FSPDF_ViewerPref_SetPrintRanges(FSCRT_DOCUMENT document, const FS_INT32 *pageRanges, FS_INT32 count)
Set the page ranges to be printed.
int FS_RESULT
Result code for functions in Foxit PDF SDK.
Definition: fs_base_r.h:160

Foxit Corporation