fpdf_document_r.h File Reference

Header file for PDF Document module of Foxit PDF SDK. More...

Go to the source code of this file.

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...
 

Macros

Macro Definitions for Password Types
Note
A PDF document can have a user password and an owner password.
While loading or reloading a PDF file, a password can be passed to the function FSPDF_Doc_StartLoad or FSPDF_Doc_StartReLoad.
In order to check which type of password is used, applications can call the function FSPDF_Doc_GetPasswordType.
#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
Note
These types indicate PDF document's encrypted patterns.
#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
Note
PDF defines two situations for PDF applications: one is full-screen and the other one is normal screen.
Function FSPDF_Doc_GetDisplayMode specifies the base display mode, and function FSPDF_ViewerPref_GetNonFullScreenPageMode specifies normal display mode (non full-screen).
Display modes tell how application displays PDF document.
#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
Note
These flags indicate numbering styles to be used for the numeric portion of each page label.
#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
Note
Each bookmark item has the status to indicate how to display it.
Combine the following flags while using them in FSPDF_BOOKMARKDATA::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
Note
Bookmark position specifies where a new bookmark item is inserted.
Please refer to function FSPDF_Bookmark_Insert.
#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.
 

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...
 

Detailed Description

Header file for PDF Document module of Foxit PDF SDK.

Copyright (C) 2003-2016, Foxit Software Inc.. All Rights Reserved.

http://www.foxitsoftware.com

The following code is copyrighted and contains proprietary information and trade secrets of Foxit Software Inc.. You cannot distribute any part of Foxit PDF SDK to any third party or general public, unless there is a separate license agreement with Foxit Software Inc. which explicitly grants you such rights.

This header file provides direct access to PDF document.
It contains:

  • 1. Load, reload or close document from file.
  • 2. Get catalog dictionary, document information dictionary and encryption dictionary.
  • 3. Get PDF document properties.
  • 4. Get PDF page objects.
  • 5. Support for document trigger actions.
  • 6. PDF page label support.
  • 7. Get PDF metadata.
  • 8. Access PDF bookmarks.
  • 9. Get PDF viewer preferences.
  • 10.Access attachments.
Note
If you want to purchase Foxit PDF SDK license and use ANY of the following functions, please request for enabling Standard module explicitly.

Foxit Corporation