Definitions for access to PDF document.
Definitions and functions in this module are included in fpdf_document_r.h and fpdf_document_w.h.
Module: PDFDocument
License Identifier: PDFDocument/All
Available License Right: Reading/Writing
For License Right Reading, see fpdf_document_r.h.
For License Right Writing, see fpdf_document_w.h.
More...
Classes | |
struct | FSPDF_ENUMPAGEINFOHANDLER |
Structure for page information enumeration. More... | |
struct | FSPDF_WRAPPERDATA |
Structure for wrapper data. More... | |
struct | FSPDF_IDENTITYPROPERTIES |
Structure for identity properties of the current user of the application. More... | |
struct | FSPDF_MENULIST |
Structure for menu list. More... | |
struct | FSPDF_JAVASCRIPTACTION_HANDLER |
Structure for action handler information. More... | |
struct | FSPDF_BOOKMARK_ITERATOR |
Handle type to PDF bookmark iterator. More... | |
struct | FSPDF_BOOKMARKPOS |
Handle type to PDF bookmark position. More... | |
struct | FSPDF_BOOKMARKDATA |
Structure for bookmark data. More... | |
struct | FSPDF_ATTACHMENTS |
Handle type to PDF attachments. More... | |
Functions | |
FS_RESULT | FSPDF_Doc_StartLoad (FSCRT_FILE file, const FSCRT_BSTR *password, FSCRT_DOCUMENT *document, FSCRT_PROGRESS *progress) |
Load a PDF file. More... | |
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. More... | |
FS_RESULT | FSPDF_Doc_StartReLoad (FSCRT_DOCUMENT document, FSCRT_FILE file, const FSCRT_BSTR *password, FSCRT_PROGRESS *progress) |
Reload PDF file. More... | |
FS_RESULT | FSPDF_Doc_Close (FSCRT_DOCUMENT document) |
Close a PDF document. More... | |
FS_RESULT | FSPDF_Doc_GetCatalog (FSCRT_DOCUMENT document, FSPDF_OBJECT *object) |
Get the PDF document catalog object. More... | |
FS_RESULT | FSPDF_Doc_GetTrailer (FSCRT_DOCUMENT document, FSPDF_OBJECT *trailer) |
Get the PDF document trailer dictionary. More... | |
FS_RESULT | FSPDF_Doc_GetInfoDict (FSCRT_DOCUMENT document, FSPDF_OBJECT *object) |
Get the PDF document info object. More... | |
FS_RESULT | FSPDF_Doc_GetEncryptDict (FSCRT_DOCUMENT document, FSPDF_OBJECT *object) |
Get the PDF document encrypt dictionary. More... | |
FS_RESULT | FSPDF_Doc_GetPasswordType (FSCRT_DOCUMENT document, FS_INT32 *type) |
Get current password type. More... | |
FS_RESULT | FSPDF_Doc_GetEncryptionType (FSCRT_DOCUMENT document, FS_INT32 *type) |
Get current encryption type. More... | |
FS_RESULT | FSPDF_Doc_GetEncryptionFilter (FSCRT_DOCUMENT document, FSCRT_BSTR *filter) |
Get encryption filter value. More... | |
FS_RESULT | FSPDF_Doc_GetEncryptionSubFilter (FSCRT_DOCUMENT document, FSCRT_BSTR *subFilter) |
Get encryption sub-filter value. More... | |
FS_RESULT | FSPDF_Doc_GetEncryptionParam (FSCRT_DOCUMENT document, const FSCRT_BSTR *key, FSCRT_BSTR *value) |
Get encryption parameter value. More... | |
FS_RESULT | FSPDF_Doc_GetUserPermissions (FSCRT_DOCUMENT document, FS_DWORD *permissions) |
Get user permissions specified in PDF document. More... | |
FS_RESULT | FSPDF_Doc_GetDisplayMode (FSCRT_DOCUMENT document, FS_INT32 *displayMode) |
Get display mode specified in PDF document. More... | |
FS_RESULT | FSPDF_Doc_GetFileVersion (FSCRT_DOCUMENT document, FS_INT32 *version) |
Get PDF file version stored in PDF header section. More... | |
FS_RESULT | FSPDF_Doc_IsModified (FSCRT_DOCUMENT document, FS_BOOL *isModified) |
Get PDF document modify mark. More... | |
FS_RESULT | FSPDF_Doc_IsPortfolio (FSCRT_DOCUMENT document, FS_BOOL *isPortfolio) |
Whether a document is a portfolio file or not. More... | |
FS_RESULT | FSPDF_Doc_CountPages (FSCRT_DOCUMENT document, FS_INT32 *count) |
Get page count in document. More... | |
FS_RESULT | FSPDF_Doc_GetPage (FSCRT_DOCUMENT document, FS_INT32 index, FSCRT_PAGE *page) |
Get a page object. More... | |
FS_RESULT | FSPDF_Doc_EnumPagesInfo (FSCRT_DOCUMENT document, FSPDF_ENUMPAGEINFOHANDLER *enumHandler) |
Enumerate the information of all PDF pages. More... | |
FS_RESULT | FSPDF_WrapperData_Init (FSPDF_WRAPPERDATA *wrapperData) |
Helper function to initialize a wrapper data object. More... | |
FS_RESULT | FSPDF_WrapperData_Clear (FSPDF_WRAPPERDATA *wrapperData) |
Helper function to clear a wrapper data object. More... | |
FS_RESULT | FSPDF_Doc_IsWrapper (FSCRT_DOCUMENT document, FS_BOOL *isWrapper) |
Determine whether the document is a wrapper document or not. More... | |
FS_RESULT | FSPDF_Doc_GetWrapperOffset (FSCRT_DOCUMENT document, FSCRT_FILESIZE *offset) |
Get wrapper offset. More... | |
FS_RESULT | FSPDF_Doc_GetWrapperData (FSCRT_DOCUMENT document, FSPDF_WRAPPERDATA *wrapperData) |
Get wrapper data. More... | |
FS_RESULT | FSPDF_Doc_CountActions (FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 *count) |
Get the count of document trigger actions. More... | |
FS_RESULT | FSPDF_Doc_GetAction (FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index, FSPDF_ACTIONDATA *actionData) |
Get document trigger action. More... | |
FS_RESULT | FSPDF_Doc_SetJavaScriptActionHandler (FSCRT_DOCUMENT document, FSPDF_JAVASCRIPTACTION_HANDLER *actionHandler) |
Set the action handler to the PDF document. More... | |
FS_RESULT | FSPDF_Doc_InitiateJavaScript (FSCRT_DOCUMENT document) |
Perform the document javascript when document is opened, defining JavaScript functions for use by other scripts in the document. More... | |
FS_RESULT | FSPDF_Doc_DoJavaScriptAction (FSCRT_DOCUMENT document, FS_INT32 trigger) |
Perform the document javascript which is specified by the trigger. More... | |
FS_RESULT | FSPDF_Doc_GetJSActionByName (FSCRT_DOCUMENT document, const FSCRT_BSTR *name, FSPDF_ACTIONDATA *actionData) |
Get a document JavaScript action by its action name. More... | |
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. More... | |
FS_RESULT | FSPDF_Doc_PageIndexToPageLabel (FSCRT_DOCUMENT document, FS_INT32 pageIndex, FSCRT_BSTR *pageLabel) |
Convert a page index to page label. More... | |
FS_RESULT | FSPDF_PageLabels_CountRanges (FSCRT_DOCUMENT document, FS_INT32 *count) |
Get count of ranges of page labels which use different numbering systems. More... | |
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. More... | |
FS_RESULT | FSPDF_Metadata_GetString (FSCRT_DOCUMENT document, const FSCRT_BSTR *key, FSCRT_BSTR *string) |
Get a UTF-8 string value from metadata. More... | |
FS_RESULT | FSPDF_Metadata_GetStringArray (FSCRT_DOCUMENT document, const FSCRT_BSTR *key, FSCRT_ARRAY *stringArray) |
Get an UTF-8 string array value from metadata. More... | |
FS_RESULT | FSPDF_Metadata_GetDateTime (FSCRT_DOCUMENT document, const FSCRT_BSTR *key, FSCRT_DATETIMEZONE *dt) |
Get a date and time value from metadata. More... | |
FS_RESULT | FSPDF_BookmarkData_Init (FSPDF_BOOKMARKDATA *bmData) |
Helper function to initialize a bookmark data object. More... | |
FS_RESULT | FSPDF_BookmarkData_Clear (FSPDF_BOOKMARKDATA *bmData) |
Helper function to clear a bookmark data. More... | |
FS_RESULT | FSPDF_Doc_CreateBookmarkIterator (FSCRT_DOCUMENT document, FSPDF_BOOKMARK_ITERATOR *iterator) |
Create an iterator to access bookmark in a document. More... | |
FS_RESULT | FSPDF_Bookmark_GetPos (FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKPOS *pos) |
Get the bookmark position handle from a bookmark iterator. More... | |
FS_RESULT | FSPDF_Bookmark_CloneIterator (FSPDF_BOOKMARK_ITERATOR srcIterator, FSPDF_BOOKMARK_ITERATOR *clonedIterator) |
Clone an iterator to access bookmark in a document. More... | |
FS_RESULT | FSPDF_Bookmark_ReleaseIterator (FSPDF_BOOKMARK_ITERATOR iterator) |
Release a bookmark iterator. More... | |
FS_RESULT | FSPDF_Bookmark_ReleasePos (FSPDF_BOOKMARKPOS pos) |
Release a bookmark position handle. More... | |
FS_RESULT | FSPDF_Bookmark_MoveToRoot (FSPDF_BOOKMARK_ITERATOR iterator) |
Move a bookmark iterator to root. More... | |
FS_RESULT | FSPDF_Bookmark_IsRoot (FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL *isRoot) |
Determine whether a bookmark iterator is root or not. More... | |
FS_RESULT | FSPDF_Bookmark_MoveToParent (FSPDF_BOOKMARK_ITERATOR iterator) |
Move a bookmark iterator to its parent if existing. More... | |
FS_RESULT | FSPDF_Bookmark_MoveToFirstChild (FSPDF_BOOKMARK_ITERATOR iterator) |
Move a bookmark iterator to its first child if existing. More... | |
FS_RESULT | FSPDF_Bookmark_MoveToNextSibling (FSPDF_BOOKMARK_ITERATOR iterator) |
Move a bookmark iterator to its next sibling if existing. More... | |
FS_RESULT | FSPDF_Bookmark_MoveToPrevSibling (FSPDF_BOOKMARK_ITERATOR iterator) |
Move a bookmark iterator to its previous sibling if existing. More... | |
FS_RESULT | FSPDF_Bookmark_MoveToPos (FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKPOS newPos) |
Move a bookmark iterator to a specific position. More... | |
FS_RESULT | FSPDF_Bookmark_HasChild (FSPDF_BOOKMARK_ITERATOR iterator, FS_BOOL *hasChild) |
Detect whether a bookmark iterator has a child or not. More... | |
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. More... | |
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. More... | |
FS_RESULT | FSPDF_Bookmark_GetData (FSPDF_BOOKMARK_ITERATOR iterator, FSPDF_BOOKMARKDATA *bmData) |
Get current bookmark iterator's data which is indicated by parameter iterator. More... | |
FS_RESULT | FSPDF_Bookmark_CountActions (FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 *count) |
Get counts of bookmark action. More... | |
FS_RESULT | FSPDF_Bookmark_GetAction (FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index, FSPDF_ACTIONDATA *actionData) |
Get bookmark action. More... | |
FS_RESULT | FSPDF_ViewerPref_GetUIVisibility (FSCRT_DOCUMENT document, const FSCRT_BSTR *uiItem, FS_BOOL *uiVisible) |
Get UI visibility status from viewer preferences. More... | |
FS_RESULT | FSPDF_ViewerPref_GetNonFullScreenPageMode (FSCRT_DOCUMENT document, FS_INT32 *displayMode) |
Get display mode for non full-screen mode from viewer preferences. More... | |
FS_RESULT | FSPDF_ViewerPref_GetReadingDirection (FSCRT_DOCUMENT document, FS_INT32 *direction) |
Get reading direction from viewer preferences. More... | |
FS_RESULT | FSPDF_ViewerPref_GetAreaType (FSCRT_DOCUMENT document, const FSCRT_BSTR *boxItem, FS_INT32 *boxType) |
Get the type of area item from viewer preferences. More... | |
FS_RESULT | FSPDF_ViewerPref_GetPrintScale (FSCRT_DOCUMENT document, FSCRT_BSTR *printScale) |
Get page scaling option from viewer preferences. More... | |
FS_RESULT | FSPDF_ViewerPref_GetPrintCopies (FSCRT_DOCUMENT document, FS_INT32 *copies) |
Get the number of copies to be printed. More... | |
FS_RESULT | FSPDF_ViewerPref_GetPrintRanges (FSCRT_DOCUMENT document, FS_INT32 *pageRanges, FS_INT32 *count) |
Get page ranges which allowed to print. More... | |
FS_RESULT | FSPDF_Doc_LoadAttachments (FSCRT_DOCUMENT document, FSPDF_ATTACHMENTS *attachments) |
Load all attachments of PDF document. More... | |
FS_RESULT | FSPDF_Attachments_Release (FSPDF_ATTACHMENTS attachments) |
Release a attachments object. More... | |
FS_RESULT | FSPDF_Attachments_CountAttachment (FSPDF_ATTACHMENTS attachments, FS_INT32 *count) |
Get the count of attachments. More... | |
FS_RESULT | FSPDF_Attachments_GetAttachment (FSPDF_ATTACHMENTS attachments, FS_INT32 index, FSPDF_ATTACHMENT *attachment) |
Get a specific attachment. More... | |
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 pages, annots, and AcroForm. More... | |
FS_RESULT | FSPDF_Doc_GetFontByIndex (FSCRT_DOCUMENT document, FS_INT32 index, FSCRT_FONT *font) |
Get the specific PDF font in the document. More... | |
FS_RESULT | FSPDF_Doc_ClearCache (FSCRT_DOCUMENT document) |
Clear the cache of PDF document(temporarily only for rendering), to reduce the memory usage. More... | |
FS_RESULT | FSPDF_Doc_Create (FSCRT_DOCUMENT *document) |
Create a new document object. More... | |
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 target document. More... | |
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 layer information into the target document. More... | |
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 specified by file path to the target document. More... | |
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. More... | |
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. More... | |
FS_RESULT | FSPDF_Doc_SetAction (FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index, const FSPDF_ACTIONDATA *actionData) |
Set document trigger action. More... | |
FS_RESULT | FSPDF_Doc_InsertAction (FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index, const FSPDF_ACTIONDATA *actionData) |
Insert document trigger action. More... | |
FS_RESULT | FSPDF_Doc_RemoveAction (FSCRT_DOCUMENT document, FS_INT32 trigger, FS_INT32 index) |
Remove document trigger action. More... | |
FS_RESULT | FSPDF_Doc_RemoveAllActions (FSCRT_DOCUMENT document, FS_INT32 trigger) |
Remove all document trigger action. More... | |
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. More... | |
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 whether the PDF matches the specified version. More... | |
FS_RESULT | FSPDF_Doc_SetDisplayMode (FSCRT_DOCUMENT document, FS_INT32 displayMode) |
Set display mode specified in PDF document. More... | |
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. More... | |
FS_RESULT | FSPDF_PageLabels_RemoveAll (FSCRT_DOCUMENT document) |
Delete all page labels in the PDF document. More... | |
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. More... | |
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. More... | |
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. More... | |
FS_RESULT | FSPDF_Bookmark_SetData (FSPDF_BOOKMARK_ITERATOR iterator, const FSPDF_BOOKMARKDATA *bmData) |
Set data to current bookmark positioned by parameter iterator. More... | |
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. More... | |
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 and old one with the specific index will be the next sibling. More... | |
FS_RESULT | FSPDF_Bookmark_Remove (FSPDF_BOOKMARK_ITERATOR iterator) |
Remove the current bookmark item positioned by parameter iterator. More... | |
FS_RESULT | FSPDF_Bookmark_SetAction (FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index, const FSPDF_ACTIONDATA *actionData) |
Set bookmark action. More... | |
FS_RESULT | FSPDF_Bookmark_InsertAction (FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index, const FSPDF_ACTIONDATA *actionData) |
Insert bookmark action. More... | |
FS_RESULT | FSPDF_Bookmark_RemoveAction (FSPDF_BOOKMARK_ITERATOR iterator, FS_INT32 index) |
Remove a specific bookmark action. More... | |
FS_RESULT | FSPDF_Bookmark_RemoveAllActions (FSPDF_BOOKMARK_ITERATOR iterator) |
Remove all bookmark actions. More... | |
FS_RESULT | FSPDF_Bookmark_Update (FSPDF_BOOKMARK_ITERATOR iterator) |
Update specific bookmark iterator object after structure of bookmark tree has been changed. More... | |
FS_RESULT | FSPDF_ViewerPref_SetUIVisibility (FSCRT_DOCUMENT document, const FSCRT_BSTR *uiItem, FS_BOOL uiVisible) |
Set UI visibility in viewer preferences. More... | |
FS_RESULT | FSPDF_ViewerPref_SetNonFullScreenPageMode (FSCRT_DOCUMENT document, FS_INT32 displayMode) |
Set display mode for non full-screen mode in viewer preferences. More... | |
FS_RESULT | FSPDF_ViewerPref_SetReadingDirection (FSCRT_DOCUMENT document, FS_INT32 direction) |
Set reading direction in viewer preferences. More... | |
FS_RESULT | FSPDF_ViewerPref_SetAreaType (FSCRT_DOCUMENT document, const FSCRT_BSTR *boxItem, FS_INT32 boxType) |
Set the page box type in viewer preferences. More... | |
FS_RESULT | FSPDF_ViewerPref_SetPrintScale (FSCRT_DOCUMENT document, const FSCRT_BSTR *printScale) |
Set page scaling in viewer preferences. More... | |
FS_RESULT | FSPDF_ViewerPref_SetPrintCopies (FSCRT_DOCUMENT document, FS_INT32 copies) |
Set the number of copies to be printed. More... | |
FS_RESULT | FSPDF_ViewerPref_SetPrintRanges (FSCRT_DOCUMENT document, const FS_INT32 *pageRanges, FS_INT32 count) |
Set the page ranges to be printed. More... | |
FS_RESULT | FSPDF_Attachments_InsertAttachment (FSPDF_ATTACHMENTS attachments, FS_INT32 index, FSPDF_ATTACHMENT attachment) |
Insert an attachment. More... | |
FS_RESULT | FSPDF_Attachments_RemoveAttachment (FSPDF_ATTACHMENTS attachments, FSPDF_ATTACHMENT attachment) |
Remove an attachment. More... | |
FS_RESULT | FSPDF_Doc_EmbedFont (FSCRT_DOCUMENT document, FSCRT_FONT font) |
Embed a PDF font to the PDF document. More... | |
Macro Definitions for Password Types | |
| |
#define | FSPDF_PASSWORDTYPE_INVALID -1 |
The password is invalid. | |
#define | FSPDF_PASSWORDTYPE_NOPASSWORD 0 |
No password is used in PDF document. | |
#define | FSPDF_PASSWORDTYPE_USERPASSWORD 1 |
A user password is used in PDF document. | |
#define | FSPDF_PASSWORDTYPE_OWNERPASSWORD 2 |
An owner password is used in PDF document. | |
Macro Definitions for Encryption Types | |
| |
#define | FSPDF_ENCRYPTTYPE_NOENCRYPT 0 |
No encrypt patterns. | |
#define | FSPDF_ENCRYPTTYPE_PASSWORD 1 |
Encrypt type by password. | |
#define | FSPDF_ENCRYPTTYPE_CERTIFICATE 2 |
Encrypt type by digital certificate. | |
#define | FSPDF_ENCRYPTTYPE_FOXITDRM 3 |
Encrypt type by Foxit DRM. | |
#define | FSPDF_ENCRYPTTYPE_CUSTOM 4 |
Encrypt type by customized encryption function. | |
#define | FSPDF_ENCRYPTTYPE_RMS 5 |
Encrypt type by Microsoft RMS encryption function. | |
Macro Definitions for Display Modes | |
| |
#define | FSPDF_DISPLAYMODE_USENONE 0 |
Neither document outlines nor thumbnail images are visible. | |
#define | FSPDF_DISPLAYMODE_USEOUTLINES 1 |
Document outlines (bookmarks) are visible. | |
#define | FSPDF_DISPLAYMODE_USETHUMBS 2 |
Thumbnail images are visible. | |
#define | FSPDF_DISPLAYMODE_FULLSCREEN 3 |
Full-screen mode, with no menu bar, window controls, or any other windows are visible. | |
#define | FSPDF_DISPLAYMODE_USEOC 4 |
Optional content group panels are visible. | |
#define | FSPDF_DISPLAYMODE_USEATTACHMENTS 5 |
Attachment panels are visible. | |
Macro Definitions for document's loading flag | |
#define | FSPDF_LOADFLAG_NOSTREAMCACHES 0x1 |
When load a PDF document, will not cache streams. Loading stream content into memory will improve performance for frequent access, however, it will also consume a lot of memory space. Not to cache streams may reduce the performance a little bit, but greatly reduce the memory consumption, especially when the file is big. The function FSPDF_Doc_StartLoad will cache streams by default. | |
#define | FSPDF_LOADFLAG_RELEASEFILEHANDLE 0x2 |
If set, the file used to load document will be released automatically. | |
Macro Definitions for application's information type. | |
#define | FSPDF_APPINFOTYPE_FORMSVERSION 0x0 |
The type of application forms version information. | |
#define | FSPDF_APPINFOTYPE_VIEWERTYPE 0x1 |
The type of application viewer type information. | |
#define | FSPDF_APPINFOTYPE_VIEWERVARIATION 0x2 |
The type of application viewer variation information. | |
#define | FSPDF_APPINFOTYPE_VIEWERVERSION 0x3 |
The type of application viewer version information. | |
#define | FSPDF_APPINFOTYPE_APPVERSION 0x4 |
The type of application app version information. | |
Macro Definitions for data type to be mailed. | |
#define | FSPDF_MAILTYPE_DOC 0 |
The data to be mailed is a document. | |
#define | FSPDF_MAILTYPE_FORM 1 |
The data to be mailed is a form. | |
#define | FSPDF_MAILTYPE_MSG 2 |
The data to be mailed is a string message. | |
Macro Definitions for PDF page label style | |
| |
#define | FSPDF_PAGELABEL_STYLE_None 0 |
No numbering style. | |
#define | FSPDF_PAGELABEL_STYLE_D 1 |
Decimal arabic numerals. | |
#define | FSPDF_PAGELABEL_STYLE_R 2 |
Uppercase roman numerals. | |
#define | FSPDF_PAGELABEL_STYLE_r 3 |
Lowercase roman numerals. | |
#define | FSPDF_PAGELABEL_STYLE_A 4 |
Uppercase letters (A to Z for the first 26 pages, AA to ZZ for the next 26, and so on). | |
#define | FSPDF_PAGELABEL_STYLE_a 5 |
Lowercase letters (a to z for the first 26 pages, aa to zz for the next 26, and so on). | |
Macros for Bookmark Status | |
| |
#define | FSPDF_BOOKMARKSTATUS_NORMAL 0 |
Show title as normal text in bookmark. | |
#define | FSPDF_BOOKMARKSTATUS_BOLD 1 |
Show title as bold text in bookmark. | |
#define | FSPDF_BOOKMARKSTATUS_ITALIC 2 |
Show title as italic text in bookmark. | |
#define | FSPDF_BOOKMARKSTATUS_EXPANDED 4 |
Expand bookmark. More... | |
Macros for Bookmark Position | |
| |
#define | FSPDF_BOOKMARKPOS_FIRSTCHILD 0 |
Position as first child. | |
#define | FSPDF_BOOKMARKPOS_LASTCHILD 1 |
Position as last child. | |
#define | FSPDF_BOOKMARKPOS_PREVIOUS 2 |
Position as previous sibling. | |
#define | FSPDF_BOOKMARKPOS_NEXT 3 |
Position as next sibling. | |
#define | FSPDF_BOOKMARKPOS_FIRSTSIBLING 4 |
Position as first sibling. | |
#define | FSPDF_BOOKMARKPOS_LASTSIBLING 5 |
Position as last sibling. | |
Macro Definitions for Reading Directions. | |
#define | FSPDF_READDIRECT_L2R 0 |
Reading direction from left to right. | |
#define | FSPDF_READDIRECT_R2L 1 |
Reading direction from right to left. | |
Macro Definitions for PDF Saving Flags | |
| |
#define | FSPDF_SAVEFLAG_INCREMENTAL 0x1 |
Save PDF document incrementally. Normally, this flag should not be combined with FSPDF_SAVEFLAG_NOORIGINAL. | |
#define | FSPDF_SAVEFLAG_NOORIGINAL 0x2 |
Save PDF document without original data or unchanged objects. | |
#define | FSPDF_SAVEFLAG_REMOVESECURITY 0x4 |
Save PDF document remove security. | |
#define | FSPDF_SAVEFLAG_OBJECTSTREAM 0x8 |
Save PDF document by using object stream, in order to reduce the file size. | |
#define | FSPDF_SAVEFLAG_OPTIMIZE 0x10 |
Remove the unused objects/resources when saving the document, in order to reduce the file size. If it is combined with FSPDF_SAVEFLAG_INCREMENTAL, FSPDF_SAVEFLAG_INCREMENTAL would be ignored. Only support desktop platforms for now. | |
#define | FSPDF_SAVEFLAG_INCREMENTONLY 0x20 |
Save PDF document and only offer the data of increment. Normally, this flag should not be combined with any other saving flags. More... | |
#define | FSPDF_SAVEFLAG_LINEARIZED 0x40 |
Save PDF document with linearized. More... | |
Macro Definitions for Importing Pages Flags | |
| |
#define | FSPDF_IMPORTFLAG_NORMAL 0x00 |
Import pages normally and it equals to call function FSPDF_Doc_StartImportPages. | |
#define | FSPDF_IMPORTFLAG_WITHLAYERS 0x01 |
Import pages with layers and it equals to call function FSPDF_Doc_StartImportPagesWithLayers. | |
#define | FSPDF_IMPORTFLAG_SHARESTREAM 0x02 |
Import pages without cloning stream objects into memory and it will reduce memory overhead. | |
Definitions for access to PDF document.
Definitions and functions in this module are included in fpdf_document_r.h and fpdf_document_w.h.
Module: PDFDocument
License Identifier: PDFDocument/All
Available License Right: Reading/Writing
For License Right Reading, see fpdf_document_r.h.
For License Right Writing, see fpdf_document_w.h.
This module contains following features:
#define FSPDF_BOOKMARKSTATUS_EXPANDED 4 |
Expand bookmark.
Specify current bookmark is expanded or collapsed if it has children. It is insignificant if it is a leaf node.
#define FSPDF_SAVEFLAG_INCREMENTONLY 0x20 |
Save PDF document and only offer the data of increment. Normally, this flag should not be combined with any other saving flags.
If use this flag to save PDF, Foxit PDF SDK will return only the data of increment as result:
And then application should add these data to the end of source PDF to generate the final saved PDF file.
#define FSPDF_SAVEFLAG_LINEARIZED 0x40 |
Save PDF document with linearized.
Get the count of attachments.
[in] | attachments | Handle to a FSPDF_ATTACHMENTS object returned by function FSPDF_Doc_LoadAttachments. |
[out] | count | Pointer to a FS_INT32 object that receives attachments counts. If there is any error, it will be set 0. |
FS_RESULT FSPDF_Attachments_GetAttachment | ( | FSPDF_ATTACHMENTS | attachments, |
FS_INT32 | index, | ||
FSPDF_ATTACHMENT * | attachment | ||
) |
Get a specific attachment.
[in] | attachments | Handle to a FSPDF_ATTACHMENTS object returned by function FSPDF_Doc_LoadAttachments. |
[in] | index | Index of attachment. Range: 0 to (attachmentcount-1). attachmentcount is returned by function FSPDF_Attachments_CountAttachment. |
[out] | attachment | Pointer to a FSPDF_ATTACHMENT handle that receives specific attachment. If there is any error, it will be NULL. |
FS_RESULT FSPDF_Attachments_InsertAttachment | ( | FSPDF_ATTACHMENTS | attachments, |
FS_INT32 | index, | ||
FSPDF_ATTACHMENT | attachment | ||
) |
Insert an attachment.
[in] | attachments | Handle to a FSPDF_ATTACHMENTS object returned by function FSPDF_Doc_LoadAttachments. |
[in] | index | The index of attachment. Range: 0 to (attachementcount-1). attachementcount is returned by function FSPDF_Attachments_CountAttachment. |
[in] | attachment | Handle to a FSPDF_ATTACHMENT object that specifies the handle of the attachment to be inserted. |
FS_RESULT FSPDF_Attachments_Release | ( | FSPDF_ATTACHMENTS | attachments | ) |
Release a attachments object.
[in] | attachments | Handle to a FSPDF_ATTACHMENTS object returned by function FSPDF_Doc_LoadAttachments. |
FS_RESULT FSPDF_Attachments_RemoveAttachment | ( | FSPDF_ATTACHMENTS | attachments, |
FSPDF_ATTACHMENT | attachment | ||
) |
Remove an attachment.
[in] | attachments | Handle to a FSPDF_ATTACHMENTS object returned or the parameter FSPDF_Doc_LoadAttachments. |
[in] | attachment | Handle to a valid FSPDF_ATTACHMENT object which is a PDF attachment object. |
FS_RESULT FSPDF_Bookmark_CloneIterator | ( | FSPDF_BOOKMARK_ITERATOR | srcIterator, |
FSPDF_BOOKMARK_ITERATOR * | clonedIterator | ||
) |
Clone an iterator to access bookmark in a document.
[in] | srcIterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a valid handle of bookmark iterator. |
[out] | clonedIterator | Pointer to a FSPDF_BOOKMARK_ITERATOR handle that receives cloned iterator object. If there is any error, it will be NULL. |
Get counts of bookmark action.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[out] | count | Pointer to a FS_INT32 object that receives action counts. If there is any error, it will be set 0. |
FS_RESULT FSPDF_Bookmark_GetAction | ( | FSPDF_BOOKMARK_ITERATOR | iterator, |
FS_INT32 | index, | ||
FSPDF_ACTIONDATA * | actionData | ||
) |
Get bookmark action.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[in] | index | Index of bookmark action. Range: 0 to (actioncount-1). actioncount is returned by function FSPDF_Bookmark_CountActions. |
[out] | actionData | Pointer to a FSPDF_ACTIONDATA structure that receives action data. |
FS_RESULT FSPDF_Bookmark_GetData | ( | FSPDF_BOOKMARK_ITERATOR | iterator, |
FSPDF_BOOKMARKDATA * | bmData | ||
) |
Get current bookmark iterator's data which is indicated by parameter iterator.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[out] | bmData | Pointer to a FSPDF_BOOKMARKDATA structure that receives the bookmark data. |
FS_RESULT FSPDF_Bookmark_GetPos | ( | FSPDF_BOOKMARK_ITERATOR | iterator, |
FSPDF_BOOKMARKPOS * | pos | ||
) |
Get the bookmark position handle from a bookmark iterator.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a valid handle of bookmark iterator. |
[out] | pos | Pointer to a FSPDF_BOOKMARKPOS handle that receives the bookmark position object. If there is any error, it will be NULL. |
Detect whether a bookmark iterator has a child or not.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[out] | hasChild | Pointer to a FS_BOOL object that receives the state whether a bookmark itearator has child:
|
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.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[in] | pos | Position where the new bookmark item is to be inserted. Please refer to macro definitions FSPDF_BOOKMARKPOS_XXX and this should be one of these macros. |
[in] | bmData | Pointer to a FSPDF_BOOKMARKDATA structure to insert the bookmark data. |
FS_RESULT FSPDF_Bookmark_InsertAction | ( | FSPDF_BOOKMARK_ITERATOR | iterator, |
FS_INT32 | index, | ||
const FSPDF_ACTIONDATA * | actionData | ||
) |
Insert bookmark action.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[in] | index | The index where the bookmark action to be inserted is. Range: 0 to (actioncount-1). actioncount is returned by function FSPDF_Bookmark_CountActions. If it is out of the range, parameter actionData will be inserted to the last. |
[in] | actionData | Pointer to a FSPDF_ACTIONDATA structure which to be inserted. |
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 and old one with the specific index will be the next sibling.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object and specifies the bookmark which is to be inserted to specific position. |
[in] | newParentPos | Handle to a FSPDF_BOOKMARKPOS object which specific the position of new parent bookmark of parameter iterator. |
[in] | childIndex | Index of child, which indicates where parameter iterator should be inserted under newParentPos. If this is below 0, bookmark related to iterator will be set to be the first child. If this is above current children count of new parent bookmark, bookmark related to iterator will be set to be the last child. |
Determine whether a bookmark iterator is the first child of its parent or not.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[out] | isFirstChild | Pointer to a FS_BOOL object that receives the position state:
|
Determine whether a bookmark iterator is the last child of its parent or not.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[out] | isLastChild | Pointer to a FS_BOOL object that receives the position state.
|
Determine whether a bookmark iterator is root or not.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[out] | isRoot | Pointer to a FS_BOOL object that receives the root state:
|
FS_RESULT FSPDF_Bookmark_MoveToFirstChild | ( | FSPDF_BOOKMARK_ITERATOR | iterator | ) |
Move a bookmark iterator to its first child if existing.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
FS_RESULT FSPDF_Bookmark_MoveToNextSibling | ( | FSPDF_BOOKMARK_ITERATOR | iterator | ) |
Move a bookmark iterator to its next sibling if existing.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
FS_RESULT FSPDF_Bookmark_MoveToParent | ( | FSPDF_BOOKMARK_ITERATOR | iterator | ) |
Move a bookmark iterator to its parent if existing.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
FS_RESULT FSPDF_Bookmark_MoveToPos | ( | FSPDF_BOOKMARK_ITERATOR | iterator, |
FSPDF_BOOKMARKPOS | newPos | ||
) |
Move a bookmark iterator to a specific position.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[in] | newPos | Handle to a FSPDF_BOOKMARKPOS object which specific the new position to move to. |
FS_RESULT FSPDF_Bookmark_MoveToPrevSibling | ( | FSPDF_BOOKMARK_ITERATOR | iterator | ) |
Move a bookmark iterator to its previous sibling if existing.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
FS_RESULT FSPDF_Bookmark_MoveToRoot | ( | FSPDF_BOOKMARK_ITERATOR | iterator | ) |
Move a bookmark iterator to root.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
FS_RESULT FSPDF_Bookmark_ReleaseIterator | ( | FSPDF_BOOKMARK_ITERATOR | iterator | ) |
Release a bookmark iterator.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
FS_RESULT FSPDF_Bookmark_ReleasePos | ( | FSPDF_BOOKMARKPOS | pos | ) |
Release a bookmark position handle.
[in] | pos | Handle to a FSPDF_BOOKMARKPOS object which is a bookmark position object. |
FS_RESULT FSPDF_Bookmark_Remove | ( | FSPDF_BOOKMARK_ITERATOR | iterator | ) |
Remove the current bookmark item positioned by parameter iterator.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
Remove a specific bookmark action.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[in] | index | The index of the bookmark action to be deleted. Range: 0 to (actioncount-1). actioncount is returned by function FSPDF_Bookmark_CountActions. |
FS_RESULT FSPDF_Bookmark_RemoveAllActions | ( | FSPDF_BOOKMARK_ITERATOR | iterator | ) |
Remove all bookmark actions.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
FS_RESULT FSPDF_Bookmark_SetAction | ( | FSPDF_BOOKMARK_ITERATOR | iterator, |
FS_INT32 | index, | ||
const FSPDF_ACTIONDATA * | actionData | ||
) |
Set bookmark action.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[in] | index | The index of a bookmark action. Range: 0 to (actioncount-1). actioncount is returned by function FSPDF_Bookmark_CountActions. |
[in] | actionData | Pointer to a FSPDF_ACTIONDATA structure which to be set. |
FS_RESULT FSPDF_Bookmark_SetData | ( | FSPDF_BOOKMARK_ITERATOR | iterator, |
const FSPDF_BOOKMARKDATA * | bmData | ||
) |
Set data to current bookmark positioned by parameter iterator.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is a bookmark iterator object. |
[in] | bmData | Pointer to a FSPDF_BOOKMARKDATA structure used to set. |
FS_RESULT FSPDF_Bookmark_Update | ( | FSPDF_BOOKMARK_ITERATOR | iterator | ) |
Update specific bookmark iterator object after structure of bookmark tree has been changed.
Structure of bookmark tree may be changed by adding a new bookmark node , remove a existed bookmark node, or move a bookmark node to a new place. After doing these changes, the application should call this function to update bookmark iterators which are kept by application and are not used directly in these changes. If the bookmark node which is related to parameter iterator has been removed, iterator will be set to root and return value of this function will be FSCRT_ERRCODE_NOTFOUND.
[in] | iterator | Handle to a FSPDF_BOOKMARK_ITERATOR object which is to be updated. |
FS_RESULT FSPDF_BookmarkData_Clear | ( | FSPDF_BOOKMARKDATA * | bmData | ) |
Helper function to clear a bookmark data.
[in] | bmData | Pointer to a FSPDF_BOOKMARKDATA structure which is a valid bookmark data object. |
FS_RESULT FSPDF_BookmarkData_Init | ( | FSPDF_BOOKMARKDATA * | bmData | ) |
Helper function to initialize a bookmark data object.
[in] | bmData | Pointer to a FSPDF_BOOKMARKDATA structure which is a valid bookmark data object. |
FS_RESULT FSPDF_Doc_ClearCache | ( | FSCRT_DOCUMENT | document | ) |
Clear the cache of PDF document(temporarily only for rendering), to reduce the memory usage.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
FS_RESULT FSPDF_Doc_Close | ( | FSCRT_DOCUMENT | document | ) |
Close a PDF document.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
Get the count of document trigger actions.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | trigger | An integer value for type of trigger action of document. Please refer to macro definition FSPDF_TRIGGER_DOC_XXX and this should be one of these macros. |
[out] | count | Pointer to a FS_INT32 object that receives trigger action counts. If there is any error, it will be set 0. |
Count all the PDF fonts in the document, this function would enumerate all the font resources for pages, annots, and AcroForm.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | count | Pointer to a integer object that receives the count of fonts. |
Get page count in document.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | count | Pointer to a FS_INT32 object that receives the count of total pages in parameter document. If there is any error, it will be set 0. |
FS_RESULT FSPDF_Doc_Create | ( | FSCRT_DOCUMENT * | document | ) |
Create a new document object.
[out] | document | Pointer to a FSCRT_DOCUMENT handle that receives a PDF document object. If there is any error, it will be NULL. |
FS_RESULT FSPDF_Doc_CreateBookmarkIterator | ( | FSCRT_DOCUMENT | document, |
FSPDF_BOOKMARK_ITERATOR * | iterator | ||
) |
Create an iterator to access bookmark in a document.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | iterator | Pointer to a FSPDF_BOOKMARK_ITERATOR handle that receives an iterator object which presents the root. If there is any error, it will be NULL. |
Perform the document javascript which is specified by the trigger.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a document object. It should be valid. |
[in] | trigger | Type of the trigger event. Please refer to macro definitions FSPDF_TRIGGER_DOC_XXX and this should be one of these macros. |
FS_RESULT FSPDF_Doc_EmbedFont | ( | FSCRT_DOCUMENT | document, |
FSCRT_FONT | font | ||
) |
Embed a PDF font to the PDF document.
Currently, this function can only support to embed a non-embedded PDF font. "PDF font" here means that the font has been used for any text object in a PDF document. User should embed a font by following process:
For other process to embed a font, this function may still run successfully, but in the saved PDF text objects may be wrong or unexpected.
Some unsupported situation:
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | font | Handle to a FSCRT_FONT object, which should have been used for text objects in parameter document and has not been embedded yet. |
FS_RESULT FSPDF_Doc_EnumPagesInfo | ( | FSCRT_DOCUMENT | document, |
FSPDF_ENUMPAGEINFOHANDLER * | enumHandler | ||
) |
Enumerate the information of all PDF pages.
This function is used for enumerating the information of all pages quickly. Application can get page specified information for each page from the callback function of enumHandler.
If the parameter document is loaded in asynchronous mode, application should ensure that data of document is available, and the data of all pages are available as well.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | enumHandler | Pointer to a FSPDF_ENUMPAGEINFOHANDLER structure which is a page info enumeration handler. Unused callback function pointer of this handler should be set to NULL. |
FS_RESULT FSPDF_Doc_GetAction | ( | FSCRT_DOCUMENT | document, |
FS_INT32 | trigger, | ||
FS_INT32 | index, | ||
FSPDF_ACTIONDATA * | actionData | ||
) |
Get document trigger action.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | trigger | An integer value for type of trigger action of document. Please refer to macro definition FSPDF_TRIGGER_DOC_XXX and this should be one of these macros. |
[in] | index | Index of trigger actions of document. Range: 0 to (actioncount-1). actioncount is returned by function FSPDF_Doc_CountActions, with same parameter trigger. |
[out] | actionData | Pointer to a FSPDF_ACTIONDATA structure that receives trigger action data. |
FS_RESULT FSPDF_Doc_GetCatalog | ( | FSCRT_DOCUMENT | document, |
FSPDF_OBJECT * | object | ||
) |
Get the PDF document catalog object.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. |
[out] | object | Pointer to a FSPDF_OBJECT handle that receives the catalog object. It should be a dictionary. If there is any error, it will be NULL. |
Get display mode specified in PDF document.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | displayMode | Pointer to a FS_INT32 object that receives display mode for the application. Please refer to macro definition FSPDF_DISPLAYMODE_XXX and this would be one of these macros. If there is any error, it will be set -1. |
FS_RESULT FSPDF_Doc_GetEncryptDict | ( | FSCRT_DOCUMENT | document, |
FSPDF_OBJECT * | object | ||
) |
Get the PDF document encrypt dictionary.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. |
[out] | object | Pointer to a FSPDF_OBJECT handle that receives the encrypt dictionary object. It should be a dictionary. If there is any error, it will be NULL. |
FS_RESULT FSPDF_Doc_GetEncryptionFilter | ( | FSCRT_DOCUMENT | document, |
FSCRT_BSTR * | filter | ||
) |
Get encryption filter value.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | filter | Pointer to a FSCRT_BSTR structure that receives encryption filter. It should not be NULL. If there is any error, FSCRT_BSTR::str will be set empty if it is not NULL while calling this function, and FSCRT_BSTR::len will be set 0. |
FS_RESULT FSPDF_Doc_GetEncryptionParam | ( | FSCRT_DOCUMENT | document, |
const FSCRT_BSTR * | key, | ||
FSCRT_BSTR * | value | ||
) |
Get encryption parameter value.
Different encryption method will have different security dictionaries. So the value of parameter key depends on the encryption dictionary.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | key | Pointer to a UTF-8 key string, it should be a valid pointer to FSCRT_BSTR structure. |
[out] | value | Pointer to a FSCRT_BSTR structure that receives the string data. User should call function FSCRT_BStr_Clear to free the memory if not using it any more. If there is any error, FSCRT_BSTR::str will be set empty if it is not NULL while calling this function, and FSCRT_BSTR::len will be set 0. |
FS_RESULT FSPDF_Doc_GetEncryptionSubFilter | ( | FSCRT_DOCUMENT | document, |
FSCRT_BSTR * | subFilter | ||
) |
Get encryption sub-filter value.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | subFilter | Pointer to a FSCRT_BSTR structure that receives encryption sub-filter, it should not be NULL. If there is any error, FSCRT_BSTR::str will be set empty if it is not NULL while calling this function, and FSCRT_BSTR::len will be set 0. |
Get current encryption type.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | type | Pointer to a FS_INT32 object that receives encryption type. Currently it would be one of the following macro definitions: If there is any error, it will be set -1. |
Get PDF file version stored in PDF header section.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | version | Pointer to a FS_INT32 object that receives the file version, such as 14 for 1.4, 15 for 1.5, and etc. If there is any error, it will be set 0. |
Get the specific PDF font in the document.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | index | The index of the specific font. |
[out] | font | Pointer to a FSCRT_FONT handle that receives the specific font. Caller may use functions FSCRT_Font_XXX to get the basic font information or FSPDF_Font_XXX to get font information that related to PDF document. Function FSCRT_Font_Release should be called to release the font when it is not used. |
FS_RESULT FSPDF_Doc_GetInfoDict | ( | FSCRT_DOCUMENT | document, |
FSPDF_OBJECT * | object | ||
) |
Get the PDF document info object.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. |
[out] | object | Pointer to a FSPDF_OBJECT handle that receives the info object. It should be a dictionary. If there is any error, it will be NULL. |
FS_RESULT FSPDF_Doc_GetJSActionByName | ( | FSCRT_DOCUMENT | document, |
const FSCRT_BSTR * | name, | ||
FSPDF_ACTIONDATA * | actionData | ||
) |
Get a document JavaScript action by its action name.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | name | Pointer to a FSCRT_BSTR structure to specify the name of a JavaScript action. It should be a UTF-8 string. |
[out] | actionData | Pointer to a FSPDF_ACTIONDATA structure that receives trigger action data. |
Get a page object.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | index | Index of PDF page. Range: 0 to (pagecount-1). pagecount is returned by function FSPDF_Doc_CountPages. |
[out] | page | Pointer to a FSCRT_PAGE handle that receives a page object. If there is any error, it will be NULL. |
Get current password type.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | type | Pointer to a FS_INT32 object that receives the password type. Currently it would be one of the following macro definitions: If there is any error, it will be set -2. |
FS_RESULT FSPDF_Doc_GetTrailer | ( | FSCRT_DOCUMENT | document, |
FSPDF_OBJECT * | trailer | ||
) |
Get the PDF document trailer dictionary.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. |
[out] | trailer | Pointer to a FSPDF_OBJECT handle that receives the trailer dictionary. It should be a dictionary. If there is any error, it will be NULL. |
Get user permissions specified in PDF document.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | permissions | Pointer to a FS_DWORD object that receives user permissions. Please refer to macro definition FSPDF_PERMISSION_XXX and this would be one or a combination of these macros. If there is any error, it will be set 0. |
FS_RESULT FSPDF_Doc_GetWrapperData | ( | FSCRT_DOCUMENT | document, |
FSPDF_WRAPPERDATA * | wrapperData | ||
) |
Get wrapper data.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | wrapperData | Pointer to a FSPDF_WRAPPERDATA structure that receives wrapper data. |
FS_RESULT FSPDF_Doc_GetWrapperOffset | ( | FSCRT_DOCUMENT | document, |
FSCRT_FILESIZE * | offset | ||
) |
Get wrapper offset.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | offset | Pointer to a FSCRT_FILESIZE structure that receives wrapper offset. In order to keep forward compatibilities, use 64-bits here. If there is any error, the value of FSCRT_FILESIZE will be set 0. |
FS_RESULT FSPDF_Doc_InitiateJavaScript | ( | FSCRT_DOCUMENT | document | ) |
Perform the document javascript when document is opened, defining JavaScript functions for use by other scripts in the document.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a document object. It should be valid. |
FS_RESULT FSPDF_Doc_InsertAction | ( | FSCRT_DOCUMENT | document, |
FS_INT32 | trigger, | ||
FS_INT32 | index, | ||
const FSPDF_ACTIONDATA * | actionData | ||
) |
Insert document trigger action.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | trigger | An integer value for trigger actions of document. Please refer to macro definition FSPDF_TRIGGER_DOC_XXX and this should be one of these macros. |
[in] | index | The index of trigger actions of document. Range: 0 to (actioncount-1). actioncount is returned by function FSPDF_Doc_CountActions. If it is out of the range, parameter actionData will be inserted to the last. |
[in] | actionData | Pointer to a FSPDF_ACTIONDATA structure which to be inserted. |
Get PDF document modify mark.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | isModified | Pointer to a FS_BOOL object that receives the modify mark. If there is any error, it will be set FALSE. |
Whether a document is a portfolio file or not.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | isPortfolio | Pointer to a FS_BOOL object that receives the boolean value which indicates whether the file is portfolio or not. If there is any error, it will be set FALSE. |
Determine whether the document is a wrapper document or not.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | isWrapper | Pointer to a FS_BOOL object that receives wrapper state.:
|
FS_RESULT FSPDF_Doc_LoadAttachments | ( | FSCRT_DOCUMENT | document, |
FSPDF_ATTACHMENTS * | attachments | ||
) |
Load all attachments of PDF document.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | attachments | Pointer to a FSPDF_ATTACHMENTS handle that receives an attachments object. If there is any error, it will be NULL. |
FS_RESULT FSPDF_Doc_PageIndexToPageLabel | ( | FSCRT_DOCUMENT | document, |
FS_INT32 | pageIndex, | ||
FSCRT_BSTR * | pageLabel | ||
) |
Convert a page index to page label.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | pageIndex | The index of page. Range: 0 to (pagecount-1). pagecount is returned by function FSPDF_Doc_CountPages. |
[out] | pageLabel | Pointer to a FSCRT_BSTR structure that receives page label string. It will be in UTF-8 format If there is any error, FSCRT_BSTR::str will be set empty if it is not NULL while calling this function, and FSCRT_BSTR::len will be set 0. |
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.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | noCase | A FS_BOOL value which indicates to use case-insensitive when its value is TRUE, or to use case-sensitive when its value is FALSE. |
[in] | pageLabel | Pointer to a FSCRT_BSTR structure which is a page label. It should be a valid UTF-8 string. |
[out] | pageIndex | Pointer to a FS_INT32 object that receives the page index corresponding to parameter pageLabel. If there is any error, it will be set -1. |
Remove document trigger action.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | trigger | An integer value for trigger actions of document. Please refer to macro definition FSPDF_TRIGGER_DOC_XXX and this should be one of these macros. |
[in] | index | The index of trigger actions of document. Range: 0 to (actioncount-1). actioncount is returned by function FSPDF_Doc_CountActions. |
Remove all document trigger action.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | trigger | An integer value for trigger actions of document. Please refer to macro definition FSPDF_TRIGGER_DOC_XXX and this should be one of these macros. |
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.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | name | Pointer to a FSCRT_BSTR structure to specify the name of a JavaScript action. It should be a UTF-8 string. |
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.
PDF wrapper is an extended standard, and it helps to hint some information to viewers.
PDF wrapper consists of
This function uses the current size of parameter file to set wrapper offset.
[in] | wrapperDoc | Handle to a FSCRT_DOCUMENT object which is a wrapper document. This function save parameter wrapperDoc as wrapper by the end of file. |
[in] | file | Handle to a FSCRT_FILE object. Parameter wrapperDoc will be saved into it. |
[in] | wrapperData | Pointer to a FSPDF_WRAPPERDATA structure which contains wrapper data. If it is NULL, no wrapper data is used. |
[in] | userPermissions | User permissions for the wrapper document. Pass 0xFFFFFFFC if it needs no special permissions. Please refer to macro definitions FSPDF_PERMISSION_XXX and this can be one or a combination of these macros. |
[in] | ownerPassword | Pointer to a FSCRT_BSTR structure which is owner password. If it is NULL, parameter userPermissions is ignored. |
FS_RESULT FSPDF_Doc_SetAction | ( | FSCRT_DOCUMENT | document, |
FS_INT32 | trigger, | ||
FS_INT32 | index, | ||
const FSPDF_ACTIONDATA * | actionData | ||
) |
Set document trigger action.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | trigger | An integer value for trigger actions of document. Please refer to macro definition FSPDF_TRIGGER_DOC_XXX and this should be one of these macros. |
[in] | index | The index of trigger actions of document. Range: 0 to (actioncount-1). actioncount is returned by function FSPDF_Doc_CountActions. |
[in] | actionData | Pointer to a FSPDF_ACTIONDATA structure used to set. |
Set display mode specified in PDF document.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | displayMode | Please refer to macro definition FSPDF_DISPLAYMODE_XXX and this should be one of these macros. |
Specify the PDF file version which will be stored in PDF header section. This function does not check whether the PDF matches the specified version.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | version | An integer specify the file version, such as 14 for 1.4, 15 for 1.5, and etc. Its value should be between 10 and 17, If it is out of range, then it would be reset as the closest version (10 or 17). |
FS_RESULT FSPDF_Doc_SetJavaScriptActionHandler | ( | FSCRT_DOCUMENT | document, |
FSPDF_JAVASCRIPTACTION_HANDLER * | actionHandler | ||
) |
Set the action handler to the PDF document.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | actionHandler | Pointer to a FSPDF_JAVASCRIPTACTION_HANDLER structure. |
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 target document.
It will take a long time to complete this process with large range of pages, so Foxit PDF SDK uses a progressive process to do this.
Caller should pass importProgress to function FSCRT_Progress_Continue to continue processing in steps, and should call function FSCRT_Progress_Release to destroy importProgress object if importing process is over.
[in] | dstDoc | Handle to a FSCRT_DOCUMENT object which specifies the destination PDF document handle. |
[in] | startIndex | A page index in parameter dstDoc where the imported pages will be inserted. Range: 0 to pagecount. pagecount is returned by function FSPDF_Doc_CountPages. If it equals to pagecount, it means the imported page will be added to the end of destination PDF document. |
[in] | srcDoc | Handle to a FSCRT_DOCUMENT object which specifies the source PDF document handle. |
[in] | pageRanges | Pointer to a FS_INT32 object which specifies a array to record the page ranges to be imported. In this array, 2 numbers are a pair: the first integer is the starting page number, and the second integer is the page count. If this parameter to be set NULL pointer, it means importing the whole source document. |
[in] | count | An integer value which indicates the count of elements in parameter pageRanges. It should be an even number when pageRanges is not NULL. |
[out] | importProgress | Pointer to a FSCRT_PROGRESS handle that receives a handle of progressive process. If there is any error, it will be NULL. |
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 specified by file path to the target document.
It will take a long time to complete this process with large range of pages, so Foxit PDF SDK uses a progressive process to do this.
Callers should pass importProgress to function FSCRT_Progress_Continue to continue processing in steps, and should call function FSCRT_Progress_Release to destroy importProgress object if importing process is over. If callers want to reduce memory usage during importing, flags should be with FSPDF_IMPORTFLAG_SHARESTREAM, howerver, it may reduce the performance a little bit. The files specified by srcFileName cannot be removed unless dstDoc is closed.
[in] | dstDoc | Handle to a FSCRT_DOCUMENT object which specifies the destination PDF document handle. |
[in] | startIndex | A page index in parameter dstDoc where the imported pages will be inserted. Range: 0 to pagecount. pagecount is returned by function FSPDF_Doc_CountPages. If it equals to pagecount, it means the imported page will be added to the end of destination PDF document. |
[in] | srcFileName | Pointer to a UTF-8 encoded string which specifies the source file name. It should be a valid pointer to a FSCRT_BSTR structure. |
[in] | password | Pointer to a FSCRT_BSTR structure which specifies a password to the srcFileName. It can be user password or owner password. If no password is used, please pass NULL or empty string directly. |
[in] | layerName | Pointer to a FSCRT_BSTR structure. If all content of source document is imported, the layer name in the OCProperties dictionary would be same with layerName. Otherwise, layerName would be the prefix name of the layer name in the OCProperties dictionary. It only works with FSPDF_IMPORTFLAG_WITHLAYERS and it should be NULL without this flag. |
[in] | pageRanges | Pointer to a FS_INT32 object which specifies a array to record the page ranges to be imported. In this array, 2 numbers are a pair: the first integer is the starting page index, and the second integer is the page count. If this parameter is set to NULL, all pages in the source document will be imported. |
[in] | count | An integer value which indicates the count of elements in parameter pageRanges. It should be an even number when pageRanges is not NULL. |
[in] | flags | Indicate the importing options. Please refer to macro definitions FSPDF_IMPORTPAGES_XXX and this can be one or a combination of these macros. |
[out] | importProgress | Pointer to a FSCRT_PROGRESS handle that receives a handle of progressive process. If there is any error, it will be NULL. |
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 layer information into the target document.
It will take a long time to complete this process with large range of pages, so Foxit PDF SDK uses a progressive process to do this.
Caller should pass importProgress to function FSCRT_Progress_Continue to continue processing in steps, and should call function FSCRT_Progress_Release to destroy importProgress object if importing process is over.
[in] | dstDoc | Handle to a FSCRT_DOCUMENT object which specifies the destination PDF document handle. |
[in] | startIndex | A page index in parameter dstDoc where the imported pages will be inserted. Range: 0 to pagecount. pagecount is returned by function FSPDF_Doc_CountPages. If it equals to pagecount, it means the imported page will be added to the end of destination PDF document. |
[in] | srcDoc | Handle to a FSCRT_DOCUMENT object which specifies the source PDF document handle. |
[in] | layerName | Pointer to a FSCRT_BSTR structure. If all content of source document is imported, the layer name in the OCProperties dictionary would be same with layerName. Otherwise, layerName would be the prefix name of the layer name in the OCProperties dictionary. |
[in] | pageRanges | Pointer to a FS_INT32 object which specifies a array to record the page ranges to be imported. In this array, 2 numbers are a pair: the first integer is the starting page number, and the second integer is the page count. If this parameter to be set NULL pointer, it means importing the whole source document. |
[in] | count | An integer value which indicates the count of elements in parameter pageRanges. It should be an even number when pageRanges is not NULL. |
[out] | importProgress | Pointer to a FSCRT_PROGRESS handle that receives a handle of progressive process. If there is any error, it will be NULL. |
FS_RESULT FSPDF_Doc_StartLoad | ( | FSCRT_FILE | file, |
const FSCRT_BSTR * | password, | ||
FSCRT_DOCUMENT * | document, | ||
FSCRT_PROGRESS * | progress | ||
) |
Load a PDF file.
[in] | file | Handle to a FSCRT_FILE object which is a file object to be loaded. |
[in] | password | Pointer to a FSCRT_BSTR structure which specifies a password. It can be user password or owner password. If no password is used, pass NULL or empty string directly. |
[out] | document | Pointer to a FSCRT_DOCUMENT handle that receives the PDF document. If there is any error, it will be NULL. |
[out] | progress | Reserved, currently it will be NULL. Pointer to a FSCRT_PROGRESS handle that receives a handle of progressive process. If there is any error, it will be NULL. |
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.
[in] | file | Handle to a FSCRT_FILE object which is a file object to be loaded. |
[in] | password | Pointer to a FSCRT_BSTR structure which specifies a password. It can be user password or owner password. If no password is used, pass NULL or empty string directly. |
[in] | flag | Indicate the loading options. Please refer to macro definitions FSPDF_LOADFLAG_XXX and this should be one of these macros. |
[out] | document | Pointer to a FSCRT_DOCUMENT handle that receives the PDF document. If there is any error, it will be NULL. |
[out] | progress | Reserved, currently it will be NULL. Pointer to a FSCRT_PROGRESS handle that receives a handle of progressive process. If there is any error, it will be NULL. |
FS_RESULT FSPDF_Doc_StartReLoad | ( | FSCRT_DOCUMENT | document, |
FSCRT_FILE | file, | ||
const FSCRT_BSTR * | password, | ||
FSCRT_PROGRESS * | progress | ||
) |
Reload PDF file.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | file | Handle to a FSCRT_FILE object which is a file object to be reloaded. It should be the same FSCRT_FILE object with parameter file passed to function FSPDF_Doc_StartLoad or FSPDF_Doc_StartLoadWithFlag. |
[in] | password | Pointer to a FSCRT_BSTR structure which specifies a password. It can be user password or owner password. If no password is used, pass NULL or empty string directly. |
[out] | progress | Reserved, currently it will be NULL. Pointer to a FSCRT_PROGRESS handle that receives a handle of progressive process. If there is any error, it will be NULL. |
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.
It will take a long time to save a document with complex or large content, so Foxit PDF SDK uses a progressive process to do this.
Caller should pass parameter saveProgress to function FSCRT_Progress_Continue to continue saving progressively, and should call function FSCRT_Progress_Release to destroy parameter saveProgress if the saving process is over.
To change the saved file version, the user can call function FSCRT_Progress_SetProperty to set "fileversion".
And the type of parameter values in function FSCRT_Progress_SetProperty must be FSCRT_VT_INT32.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | file | Handle to a FSCRT_FILE object which specifies another file used to save current PDF document object document. |
[in] | flag | An integer value to specify saving mode. Please refer to macro definitions FSPDF_SAVEFLAG_XXX and this can be one or a combination of these macros. |
[out] | saveProgress | Pointer to a FSCRT_PROGRESS handle that receives progressive process. If there is any error, it will be NULL. |
FS_RESULT FSPDF_Metadata_GetDateTime | ( | FSCRT_DOCUMENT | document, |
const FSCRT_BSTR * | key, | ||
FSCRT_DATETIMEZONE * | dt | ||
) |
Get a date and time value from metadata.
Metadata provides some application level information about document, such as author, title, creation time and others.
There are two ways to store these information in PDF file:
Which information would be got depends on the information of modified date, which is defined in key "ModDate" in the "Info" dictionary and "MetadataDate" in XML.
This function will get the latest modified date time between these two ways.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | key | Pointer to a UTF-8 key string, it should be a valid pointer to FSCRT_BSTR structure. Currently it can be one of the following values:
|
[out] | dt | Pointer to a FSCRT_DATETIMEZONE structure that receives a date and time value associated to parameters key. |
FS_RESULT FSPDF_Metadata_GetString | ( | FSCRT_DOCUMENT | document, |
const FSCRT_BSTR * | key, | ||
FSCRT_BSTR * | string | ||
) |
Get a UTF-8 string value from metadata.
Metadata provides some application level information about document, such as author, title, creation time and others.
There are two ways to store these information in PDF file:
Which information would be got depends on the information of modified date, which is defined in key "ModDate" in the "Info" dictionary and "MetadataDate" in XML.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | key | Pointer to a UTF-8 key string, and it should be a valid pointer to FSCRT_BSTR structure. Currently it can be one of the following macro definitions:
|
[out] | string | Pointer to a FSCRT_BSTR structure that receives a UTF-8 string value associated to parameter key. If there is any error, FSCRT_BSTR::str will be set empty if it is not NULL while calling this function, and FSCRT_BSTR::len will be set 0. |
FS_RESULT FSPDF_Metadata_GetStringArray | ( | FSCRT_DOCUMENT | document, |
const FSCRT_BSTR * | key, | ||
FSCRT_ARRAY * | stringArray | ||
) |
Get an UTF-8 string array value from metadata.
Metadata provides some application level information about document, such as author, title, creation time and others.
There are two ways to store these information in PDF file:
Which information would be got depends on the information of modified date, which is defined in key "ModDate" in the "Info" dictionary and "MetadataDate" in XML.
There could be multiple string values associated with the same key,so the result is received as an array.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object.It should be valid. |
[in] | key | Pointer to a UTF-8 key string, and it should be a valid pointer to FSCRT_BSTR structure. Currently it can be one of the following macro definitions:
|
[out] | stringArray | Pointer to a FSCRT_ARRAY structure that receives an UTF-8 string array value associated to parameter key. Application should call function FSCRT_Array_Init to initialize it and FSCRT_Array_Clear to release it. If there is any error, it will be NULL. |
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.
Metadata provides some application level information to tell the viewer document properties, such as author, title, creation time and others.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | key | Pointer to a UTF-8 key string, it should be a valid pointer to FSCRT_BSTR structure. Currently it can be one of the following values:
|
[in] | dt | Pointer to a FSCRT_DATETIMEZONE structure which is a date and time value associated to parameter key. |
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.
Metadata provides some application level information to tell a viewer something about this document, such as author, title, creation time and others.
If the key is "Keywords" or "Author" and string contains ';', ',' or any other separators identified by Adobe, the string would be surrounded with double quotes.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | key | Pointer to a UTF-8 key string, it should be a valid pointer to FSCRT_BSTR structure. Currently it can be one of the following values:
|
[in] | string | Pointer to a metadata UTF-8 string, associated to parameter key, it should be a valid pointer to FSCRT_BSTR structure. |
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.
Metadata provides some application level information to tell a viewer something about this document, such as author, title, creation time and others. The information exists in two ways: "info" dictionary in trail and metadata stream in the format of XML in the "catalog" dictionary. The information in the XML metadata stream could be format of array, this function is used to set array value. The function is compatible with the function:: FSPDF_Metadata_SetString and would both set information in two places if the key is compatible. If the key is "Keywords" or "Author" and the string in stringArray contains ';', ',' or any other separators identified by Adobe, the string would be surrounded with double quotes.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | key | Pointer to a UTF-8 key string, it should be a valid pointer to FSCRT_BSTR structure. Currently it can be one of the following values:
|
[in] | stringArray | Pointer to an UTF-8 string array. Elements in this are metadata information, which is associated to parameter key. Each element in this array should be an object of FSCRT_BSTR structure. |
[in] | count | The count of elements in parameter stringArray. |
Get count of ranges of page labels which use different numbering systems.
For purposes of page labeling, a document can be divided into labeling ranges, each of which is a series of consecutive pages using the same numbering system.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | count | Pointer to a FS_INT32 object that receives count of labeling ranges. If there is any error, it will be set -1. |
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.
For purposes of page labeling, a document can be divided into labeling ranges, each of which is a series of consecutive pages using the same numbering system. The numbering system consists of some information of page labels.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | rangeIndex | The index of the current labeling range. Valid value is from 0 to (count - 1). count is returned by function FSPDF_PageLabels_CountRanges. |
[out] | start | Pointer to a FS_INT32 object that receives the index of first page in the current range. If there is any error, it will be set -1. |
[out] | style | Pointer to a FS_INT32 object that receives the numbering style to be used for the numeric portion of each page label. Please refer to macro definitions FSPDF_PAGELABEL_STYLE_XXX and it would be one of these macros. If the value is FSPDF_PAGELABEL_STYLE_None, page labels consist solely of a label prefix with no numeric portion. If there is any error, it will be set -1. |
[out] | prefix | Pointer to a FSCRT_BSTR structure that receives a label prefix for page labels in the current range. It will be in UTF-8 format. If there is any error, FSCRT_BSTR::str will be set empty if it is not NULL while calling this function. |
[out] | st | Pointer to a FS_INT32 object that receives the value of the numeric portion for the first page label in the current range. Subsequent pages are numbered sequentially from this value, which must be greater than or equal to 1. If there is any error, it will be set 0. |
FS_RESULT FSPDF_PageLabels_RemoveAll | ( | FSCRT_DOCUMENT | document | ) |
Delete all page labels in the PDF document.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
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.
For purposes of page labeling, a document can be divided into labeling ranges, each of which is a series of consecutive pages using the same numbering system. Pages within a range are numbered sequentially in ascending order. Page labels are consecutively until a next new range.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | start | The index of first page in the current range. Valid value is from 0 to (count - 1). count is returned by function FSPDF_Doc_CountPages. |
[in] | style | An integer value which is a numbering style to be used for the numeric portion of each page label. Please refer to macro definitions FSPDF_PAGELABEL_STYLE_XXX and this should be one of these macros. If the value is FSPDF_PAGELABEL_STYLE_None, page labels consist solely of a label prefix with no numeric portion. |
[in] | prefix | Pointer to a FSCRT_BSTR structure which is a label prefix for page labels in the current range. It should be a valid UTF-8 string. If it is NULL or prefix->str is NULL or prefix->len is less than 1, it means no label prefix. |
[in] | st | An integer value which is the numeric portion for the first page label in the current range. Subsequent pages are numbered sequentially from this value, which must be greater than or equal to 1. |
FS_RESULT FSPDF_ViewerPref_GetAreaType | ( | FSCRT_DOCUMENT | document, |
const FSCRT_BSTR * | boxItem, | ||
FS_INT32 * | boxType | ||
) |
Get the type of area item from viewer preferences.
Viewer preferences defines the way that a document is to be presented on the screen or in print.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | boxItem | Pointer to a UTF-8 key string, it should be a valid pointer to FSCRT_BSTR structure. Currently it can be one of the following values:
|
[out] | boxType | Pointer to a FS_INT32 object that receives the page box type. Please refer to macro definitions FSPDF_PAGEBOX_XXX and this would be one of these macros. Default: FSPDF_PAGEBOX_CROPBOX If there is any error, it will be set -1. |
FS_RESULT FSPDF_ViewerPref_GetNonFullScreenPageMode | ( | FSCRT_DOCUMENT | document, |
FS_INT32 * | displayMode | ||
) |
Get display mode for non full-screen mode from viewer preferences.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | displayMode | Pointer to a FS_INT32 object to get display mode. It would be one of the following macro definitions:
If there is any error, it will be set -1. |
Get the number of copies to be printed.
Viewer preferences defines the way that a document is to be presented on the screen or in print.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | copies | Pointer to a FS_INT32 object that receives the number of copies to be printed when the print dialogue is opened for this file. Supported values are the integers 2 through 5. Values outside this range are ignored. Default value: as defined by PDF viewer application, but typically 1. If there is any error, it will be set 0. |
FS_RESULT FSPDF_ViewerPref_GetPrintRanges | ( | FSCRT_DOCUMENT | document, |
FS_INT32 * | pageRanges, | ||
FS_INT32 * | count | ||
) |
Get page ranges which allowed to print.
Viewer preferences defines the way that a document is to be presented on the screen or in print.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | pageRanges | Pointer to a FS_INT32 object array that receives the page ranges to be printed. In this array, 2 numbers are a pair: the first integer is the starting page number, and the second integer is the last page number. The first page of the PDF file is denoted by 1 If it is NULL, parameter count receives total count of elements of all page ranges. |
[out] | count | Pointer to a FS_INT32 object that receives the count of elements in parameter pageRanges. |
FS_RESULT FSPDF_ViewerPref_GetPrintScale | ( | FSCRT_DOCUMENT | document, |
FSCRT_BSTR * | printScale | ||
) |
Get page scaling option from viewer preferences.
Viewer preferences defines the way that a document is to be presented on the screen or in print.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | printScale | Pointer to a FSCRT_BSTR structure that receives a UTF-8 string value which specifies page scale. It would be one of following:
If there is any error, FSCRT_BSTR::str will be set empty if it is not NULL while calling this function, and FSCRT_BSTR::len will be set 0. |
Get reading direction from viewer preferences.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[out] | direction | Pointer to a FS_INT32 object that receives reading direction:
If there is any error, it will be set -1. |
FS_RESULT FSPDF_ViewerPref_GetUIVisibility | ( | FSCRT_DOCUMENT | document, |
const FSCRT_BSTR * | uiItem, | ||
FS_BOOL * | uiVisible | ||
) |
Get UI visibility status from viewer preferences.
Viewer preferences defines the way that a document is to be presented on the screen or in print.
[in] | document | Handle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid. |
[in] | uiItem | Pointer to a UTF-8 key string, it should be a valid pointer to FSCRT_BSTR structure. Currently it can be one of the following values:
|
[out] | uiVisible | Pointer to a FS_BOOL object that receives a boolean value. Default: FALSE If there is any error, it will be FALSE. |
FS_RESULT FSPDF_ViewerPref_SetAreaType | ( | FSCRT_DOCUMENT | document, |
const FSCRT_BSTR * | boxItem, | ||
FS_INT32 | boxType | ||
) |
Set the page box type in viewer preferences.
Viewer preferences define the way that a document is to be presented on the screen or for printing.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | boxItem | Pointer to a UTF-8 key string, it should be a valid pointer to FSCRT_BSTR structure. Currently it can be one of the following values:
|
[in] | boxType | An integer value which specifies a page box type. Please refer to macro definitions FSPDF_PAGEBOX_XXX and this should be one of these macros. |
FS_RESULT FSPDF_ViewerPref_SetNonFullScreenPageMode | ( | FSCRT_DOCUMENT | document, |
FS_INT32 | displayMode | ||
) |
Set display mode for non full-screen mode in viewer preferences.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | displayMode | Pointer to a FS_INT32 object to indicate display mode. It should be one of the following macro definitions: |
Set the number of copies to be printed.
Viewer preferences define the way that a document is to be presented on the screen or for printing.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | copies | An integer value which specifies the number of copies to be printed when the print dialog is opened for this file. If this is below 0, this function will typically set the number of copies to 1. Supported values are the integers 2 through 5. Values outside this range are ignored. |
FS_RESULT FSPDF_ViewerPref_SetPrintRanges | ( | FSCRT_DOCUMENT | document, |
const FS_INT32 * | pageRanges, | ||
FS_INT32 | count | ||
) |
Set the page ranges to be printed.
Viewer preferences define the way that a document is to be presented on the screen or for printing.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | pageRanges | Pointer to a FS_INT32 object which specifies a array to record the page ranges to print. In this array, 2 numbers are a pair: the first integer is the starting page number, and the second integer is the ending page number. |
[in] | count | An integer value which indicates the count of elements in the parameter pageRanges. It should be an even number. |
FS_RESULT FSPDF_ViewerPref_SetPrintScale | ( | FSCRT_DOCUMENT | document, |
const FSCRT_BSTR * | printScale | ||
) |
Set page scaling in viewer preferences.
Viewer preferences define the way that a document is to be presented on the screen or for printing.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | printScale | Pointer to a FSCRT_BSTR structure which is a UTF-8 string value to specify page scale. It should be one of following:
|
Set reading direction in viewer preferences.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | direction | An integer value which specifies reading direction:
|
FS_RESULT FSPDF_ViewerPref_SetUIVisibility | ( | FSCRT_DOCUMENT | document, |
const FSCRT_BSTR * | uiItem, | ||
FS_BOOL | uiVisible | ||
) |
Set UI visibility in viewer preferences.
Viewer preferences define the way that a document is to be presented on the screen or for printing.
[in] | document | Handle to a valid FSCRT_DOCUMENT object which is a PDF document object. |
[in] | uiItem | Pointer to a UTF-8 key string, it should be a valid pointer to FSCRT_BSTR structure. Currently it can be one of the following values:
|
[in] | uiVisible | A boolean value that specifies the UI visibility. |
FS_RESULT FSPDF_WrapperData_Clear | ( | FSPDF_WRAPPERDATA * | wrapperData | ) |
Helper function to clear a wrapper data object.
[in] | wrapperData | Pointer to a FSPDF_WRAPPERDATA structure to be cleared. |
FS_RESULT FSPDF_WrapperData_Init | ( | FSPDF_WRAPPERDATA * | wrapperData | ) |
Helper function to initialize a wrapper data object.
[in] | wrapperData | Pointer to a FSPDF_WRAPPERDATA structure to be initialized. |