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 
906 /*******************************************************************************/
907 /* Access PDF bookmarks */
908 /*******************************************************************************/
930 FS_RESULT FSPDF_Bookmark_SetData(FSPDF_BOOKMARK_ITERATOR iterator, const FSPDF_BOOKMARKDATA* bmData);
931 
958 FS_RESULT FSPDF_Bookmark_Insert(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 pos, const FSPDF_BOOKMARKDATA* bmData);
959 
992 FS_RESULT FSPDF_Bookmark_InsertAtPos(FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKPOS newParentPos, FS_INT32 childIndex);
993 
1018 FS_RESULT FSPDF_Bookmark_Remove(FSPDF_BOOKMARK_ITERATOR iterator);
1019 
1044 FS_RESULT FSPDF_Bookmark_SetAction(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index, const FSPDF_ACTIONDATA* actionData);
1045 
1072 FS_RESULT FSPDF_Bookmark_InsertAction(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index, const FSPDF_ACTIONDATA* actionData);
1073 
1097 FS_RESULT FSPDF_Bookmark_RemoveAction(FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index);
1098 
1120 FS_RESULT FSPDF_Bookmark_RemoveAllActions(FSPDF_BOOKMARK_ITERATOR iterator);
1121 
1150 FS_RESULT FSPDF_Bookmark_Update(FSPDF_BOOKMARK_ITERATOR iterator);
1151 
1152 /*******************************************************************************/
1153 /* Access PDF viewer preferences */
1154 /*******************************************************************************/
1155 
1194 FS_RESULT FSPDF_ViewerPref_SetUIVisibility(FSCRT_DOCUMENT document, const FSCRT_BSTR* uiItem, FS_BOOL uiVisible);
1195 
1228 FS_RESULT FSPDF_ViewerPref_SetNonFullScreenPageMode(FSCRT_DOCUMENT document, FS_INT32 displayMode);
1229 
1259 FS_RESULT FSPDF_ViewerPref_SetReadingDirection(FSCRT_DOCUMENT document, FS_INT32 direction);
1260 
1296 FS_RESULT FSPDF_ViewerPref_SetAreaType(FSCRT_DOCUMENT document, const FSCRT_BSTR* boxItem, FS_INT32 boxType);
1297 
1330 FS_RESULT FSPDF_ViewerPref_SetPrintScale(FSCRT_DOCUMENT document, const FSCRT_BSTR* printScale);
1331 
1361 FS_RESULT FSPDF_ViewerPref_SetPrintCopies(FSCRT_DOCUMENT document, FS_INT32 copies);
1362 
1392 FS_RESULT FSPDF_ViewerPref_SetPrintRanges(FSCRT_DOCUMENT document, const FS_INT32* pageRanges, FS_INT32 count);
1393 
1394 /*******************************************************************************/
1395 /* PDF attachments */
1396 /*******************************************************************************/
1422 FS_RESULT FSPDF_Attachments_InsertAttachment(FSPDF_ATTACHMENTS attachments, FS_INT32 index, FSPDF_ATTACHMENT attachment);
1423 
1448 FS_RESULT FSPDF_Attachments_RemoveAttachment(FSPDF_ATTACHMENTS attachments, FSPDF_ATTACHMENT attachment);
1449 
1450 /*******************************************************************************/
1451 /* PDF Fonts */
1452 /*******************************************************************************/
1494 FS_RESULT FSPDF_Doc_EmbedFont(FSCRT_DOCUMENT document, FSCRT_FONT font);
1495 
1496 #ifdef __cplusplus
1497 };
1498 #endif
1499  /* group FPDFDOCUMENT */
1501 
1502 #endif /* _FSPDF_DOCUMENT_W_H_ */
1503 
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:2197
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:2018
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_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:611
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:969
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