fpdf_base_r.h File Reference

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

Go to the source code of this file.

Classes

struct  FSPDF_DEFAULTAPPEARANCE
 Structure for default appearance. More...
 
struct  FSPDF_OBJECT
 Handle type to PDF object. More...
 
struct  FSPDF_ATTACHMENT
 Handle type to PDF attachment. More...
 
struct  FSPDF_RENDERCONTEXT
 Handle type to PDF rendering context. More...
 
struct  FSPDF_RENDEROPTIONPARAM_COLORMODE
 Structure for render option parameters of color mode. More...
 
struct  FSPDF_LAYERCONTEXT
 Handle type to PDF layer context. More...
 
struct  FSPDF_DESTDATA
 Structure for a destination data. More...
 
struct  FSPDF_ACTIONDATA
 Structure for an action data. More...
 
struct  FSPDF_ACTIONDATA_GOTO
 Structure for action type FSPDF_ACTION_GOTO. More...
 
struct  FSPDF_ACTIONDATA_REMOTEGOTO
 Structure for action type FSPDF_ACTION_REMOTEGOTO. More...
 
struct  FSPDF_ACTIONDATA_EMBEDDEDGOTO_TARGET
 Structure for target of FSPDF_ACTIONDATA_EMBEDDEDGOTO. More...
 
struct  FSPDF_ACTIONDATA_EMBEDDEDGOTO
 Structure for action type FSPDF_ACTION_EMBEDDEDGOTO. More...
 
struct  FSPDF_ACTIONDATA_URI
 Structure for action type FSPDF_ACTION_URI. More...
 
struct  FSPDF_ACTIONDATA_LAUNCH
 Structure for action type FSPDF_ACTION_LAUNCH. More...
 
struct  FSPDF_ACTIONDATA_JAVASCRIPT
 Structure for action type FSPDF_ACTION_JAVASCRIPT. More...
 
struct  FSPDF_ACTIONDATA_HIDE
 Structure for action type FSPDF_ACTION_HIDE. More...
 
struct  FSPDF_ACTIONDATA_NAMED
 Structure for action type FSPDF_ACTION_NAMED. More...
 
struct  FSPDF_ACTIONDATA_SUBMITFORM
 Structure for action type FSPDF_ACTION_SUBMITFORM. More...
 
struct  FSPDF_ACTIONDATA_RESETFORM
 Structure for action type FSPDF_ACTION_RESETFORM. More...
 
struct  FSPDF_ACTIONDATA_IMPORTDATA
 Structure for action type FSPDF_ACTION_IMPORTDATA. More...
 

Macros

Macro Definitions for PDF Document Permissions
Note
According to PDF Reference, a 32-bit integer is used to represent permissions.
Bits in permission value, 1-2 bits must be zero, 7-8, 13-32 bits must be 1, and leave other unused bits to 0.
#define FSPDF_PERMISSION_PRINT   0x0004
 Bit 3. Print PDF document with normal mode. More...
 
#define FSPDF_PERMISSION_MODIFY   0x0008
 Bit 4. Modify PDF contents. More...
 
#define FSPDF_PERMISSION_EXTRACT   0x0010
 Bit 5. Extract PDF contents. More...
 
#define FSPDF_PERMISSION_ANNOTFORM   0x0020
 Bit 6. Operate text annotations and fill in interactive form fields. More...
 
#define FSPDF_PERMISSION_FILLFORM   0x0100
 Bit 9. Fill PDF form. More...
 
#define FSPDF_PERMISSION_EXTRACTACCESS   0x0200
 Bit 10. Disabilities support. More...
 
#define FSPDF_PERMISSION_ASSEMBLE   0x0400
 Bit 11. Assemble PDF document. More...
 
#define FSPDF_PERMISSION_PRINT_HIGH   0x0800
 Bit 12. Print PDF document with higher qualities. More...
 
Macro Definitions for Page Boundary Box
Note
For some purposes, PDF defines a set of page boxes.
User can select a proper page box according to application intentions.
#define FSPDF_PAGEBOX_MEDIABOX   0
 Media Box for page boundary. More...
 
#define FSPDF_PAGEBOX_CROPBOX   1
 Crop Box for page boundary. More...
 
#define FSPDF_PAGEBOX_TRIMBOX   2
 Trim Box for page boundary. More...
 
#define FSPDF_PAGEBOX_ARTBOX   3
 Art Box for page boundary. More...
 
#define FSPDF_PAGEBOX_BLEEDBOX   4
 Bleed Box for page boundary. More...
 
Macro Definitions for Alignments (horizontal).
#define FSPDF_ALIGNMENT_LEFT   0
 Left alignment.
 
#define FSPDF_ALIGNMENT_CENTER   1
 Center alignment.
 
#define FSPDF_ALIGNMENT_RIGHT   2
 Right alignment.
 
Macro Definitions for Settings of Default Appearance
#define FSPDF_DEFAULTAPPEARANCE_FONT   0x0001
 The font flag of default appearance.
 
#define FSPDF_DEFAULTAPPEARANCE_TEXTCOLOR   0x0002
 The text color flag of default appearance.
 
#define FSPDF_DEFAULTAPPEARANCE_TEXTMATRIX   0x0004
 The text matrix flag of default appearance flag.
 
Macro Definitions for Rendering Options
Note
Currently, only one rendering option is defined.
#define FSPDF_RENDEROPTION_COLORMODE   0
 Rendering option of color mode.
 
Macro Definitions for Rendering Option of Color Mode
#define FSPDF_COLORMODE_NORMAL   0
 Normal color mode.
 
#define FSPDF_COLORMODE_GRAY   1
 Gray color mode: map colors to background/foreground.
 
#define FSPDF_COLORMODE_TWOCOLOR   2
 Two color mode: map white/black to background/foreground, other unchanged.
 
Macro Definitions for Render Flags
Note
Pass one or a combination of the following flags to parameter flags when call function FSPDF_RenderContext_SetFlags.
#define FSPDF_RENDERCONTEXTFLAG_ANNOT   0x0001
 Set if page annotations are to be rendered together.
 
#define FSPDF_RENDERCONTEXTFLAG_DROPOBJECTS   0x0002
 Drop page content objects while rendering page automatically. More...
 
#define FSPDF_RENDERCONTEXTFLAG_NOWIDGET   0x0004
 Set if the form fields(widgets) are not to be rendered together.
 
#define FSPDF_RENDERCONTEXTFLAG_NOTTRANSFORMICON   0x0008
 Set if no need to rotate or scale annotation icon. More...
 
#define FSPDF_RENDERCONTEXTFLAG_NOSIGNATURE   0x0020
 This flag indicates not to render signatures.
 
#define FSPDF_RENDERCONTEXTFLAG_OCGPRINT   0x0100
 If this flag is set, only apply those content objects which allow to output to printer.
 
#define FSPDF_RENDERCONTEXTFLAG_OCGDESIGN   0x0200
 If this flag is set, only apply those content objects which allow to output for design mode.
 
#define FSPDF_RENDERCONTEXTFLAG_OCGEXPORT   0x0400
 If this flag is set, only apply those content objects which allow to output for exportation.
 
Macro Definitions for Zoom Mode for The Destination
#define FSPDF_ZOOM_FACTOR   1
 A specific zoom factor is used.
 
#define FSPDF_ZOOM_FITPAGE   2
 Fit the whole page on the screen.
 
#define FSPDF_ZOOM_FITWIDTH   3
 Fit the width of the page on the screen.
 
#define FSPDF_ZOOM_FITHEIGHT   4
 Fit the height of the page on the screen.
 
#define FSPDF_ZOOM_FITRECT   5
 Fit a particular rectangle on the screen.
 
#define FSPDF_ZOOM_FITCONTENT   6
 Fit the whole content of page on the screen.
 
#define FSPDF_ZOOM_FITCONTENTWIDTH   7
 Fit the content width of page on the screen.
 
#define FSPDF_ZOOM_FITCONTENTHEIGHT   8
 Fit the content height of page on the screen.
 
Macro Definitions for Action Type
#define FSPDF_ACTION_UNSUPPORTED   0
 Unsupported action type.
 
#define FSPDF_ACTION_GOTO   1
 Go to a destination within current document.
 
#define FSPDF_ACTION_REMOTEGOTO   2
 Go to a destination within another document.
 
#define FSPDF_ACTION_EMBEDDEDGOTO   3
 Go to a destination within embedded another document.
 
#define FSPDF_ACTION_URI   4
 Universal Resource Identifier, including web pages and other Internet based resources.
 
#define FSPDF_ACTION_LAUNCH   5
 Launch an application or open a file.
 
#define FSPDF_ACTION_JAVASCRIPT   6
 Run a javascript.
 
#define FSPDF_ACTION_HIDE   7
 Hide or show one or more annotations.
 
#define FSPDF_ACTION_NAMED   8
 Run a named action.
 
#define FSPDF_ACTION_SUBMITFORM   9
 Transmit the names and values of selected interactive form fields.
 
#define FSPDF_ACTION_RESETFORM   10
 Reset selected interactive form fields to their default values.
 
#define FSPDF_ACTION_IMPORTDATA   11
 Import Forms Data Format (FDF) data into the document's interactive form.
 
#define FSPDF_ACTION_RENDITION   12
 Play a multimedia.
 
Macro Definitions for Trigger Actions of Document
#define FSPDF_TRIGGER_DOC_DO   0
 A JavaScript action to be performed after opening a document.
 
#define FSPDF_TRIGGER_DOC_WC   1
 A JavaScript action to be performed before closing a document.
 
#define FSPDF_TRIGGER_DOC_WS   2
 A JavaScript action to be performed before saving a document.
 
#define FSPDF_TRIGGER_DOC_DS   3
 A JavaScript action to be performed after saving a document.
 
#define FSPDF_TRIGGER_DOC_WP   4
 A JavaScript action to be performed before printing a document.
 
#define FSPDF_TRIGGER_DOC_DP   5
 A JavaScript action to be performed after printing a document.
 
Macro Definitions for Trigger Actions of Form Field
#define FSPDF_TRIGGER_FORMFIELD_KS   0
 A JavaScript action to be performed when the user types a keystroke into a text field or combo box or modifies the selection in a scrollable list box. More...
 
#define FSPDF_TRIGGER_FORMFIELD_WF   1
 A JavaScript action to be performed before the field is formatted to display its current value. More...
 
#define FSPDF_TRIGGER_FORMFIELD_WV   2
 A JavaScript action to be performed when the field's value is changed. More...
 
#define FSPDF_TRIGGER_FORMFIELD_FC   3
 A JavaScript action to be performed to recalculate the value of this field when that of another field changes.
 
Macro Definitions for Trigger Actions of Page
#define FSPDF_TRIGGER_PAGE_PO   0
 An action to be performed when the page is opened.
 
#define FSPDF_TRIGGER_PAGE_PC   1
 An action to be performed when the page is closed.
 
Macro Definitions for Trigger Actions of Annotation
#define FSPDF_TRIGGER_ANNOT_CE   0
 
#define FSPDF_TRIGGER_ANNOT_CX   1
 
#define FSPDF_TRIGGER_ANNOT_MD   2
 
#define FSPDF_TRIGGER_ANNOT_MU   3
 
#define FSPDF_TRIGGER_ANNOT_FO   4
 
#define FSPDF_TRIGGER_ANNOT_FL   5
 
#define FSPDF_TRIGGER_ANNOT_PO   6
 
#define FSPDF_TRIGGER_ANNOT_PC   7
 
#define FSPDF_TRIGGER_ANNOT_PV   8
 
#define FSPDF_TRIGGER_ANNOT_PI   9
 
Macro Definitions for Submit-Form Action Flags
Note
According to PDF Reference, a 32-bit integer is used to represent submit-form action flags.
Bits in flags value, leave unused bits to be 0.
#define FSPDF_SUBMITFORMFLAGS_INCLUDE   0x0001
 Bit 1. Include fields to submit.
 
#define FSPDF_SUBMITFORMFLAGS_INCLUDENOVALUEFIELDS   0x0002
 Bit 2. Submit fields regardless of whether they have a value. More...
 
#define FSPDF_SUBMITFORMFLAGS_EXPORTFORMAT   0x0004
 Bit 3. Field names and values are submitted in HTML Form format. More...
 
#define FSPDF_SUBMITFORMFLAGS_GETMETHOD   0x0008
 Bit 4. Field names and values are submitted using an HTTP GET request. More...
 
#define FSPDF_SUBMITFORMFLAGS_SUBMITCOORDINATES   0x0010
 Bit 5. Coordinates of the mouse are transmitted as part of the form data.
 
#define FSPDF_SUBMITFORMFLAGS_XFDF   0x0020
 Bit 6. Field names and values are submitted as XFDF.
 
#define FSPDF_SUBMITFORMFLAGS_INCLUDEAPPENDSAVES   0x0040
 Bit 7. Submitted FDF file includes contents as contained in differences entry in the FDF dictionary. More...
 
#define FSPDF_SUBMITFORMFLAGS_INCLUDEANNOTATIONS   0x0080
 Bit 8. Submitted FDF file includes all markup annotations in underlying PDF document. More...
 
#define FSPDF_SUBMITFORMFLAGS_SUBMITPDF   0x0100
 Bit 9. The document is submitted as PDF.
 
#define FSPDF_SUBMITFORMFLAGS_CANONICALFORMAT   0x0200
 Bit 10. Any submitted field values representing dates are converted to the standard format.
 
#define FSPDF_SUBMITFORMFLAGS_EXCLNONUSERANNOTS   0x0400
 Bit 11. Only those markup annotations whose T entry matches the name of the current user are being submitted.
 
#define FSPDF_SUBMITFORMFLAGS_EXCLFKEY   0x0800
 Bit 12. Submitted FDF excludes F entry.
 
#define FSPDF_SUBMITFORMFLAGS_EMBEDFORM   0x2000
 Bit 14. F entry of submitted FDF is an embedded file stream.
 

Functions

FS_RESULT FSCRT_PDFModule_Initialize ()
 Initialize PDF module. More...
 
FS_RESULT FSCRT_PDFModule_Finalize ()
 Finalize PDF module. More...
 
FS_RESULT FSPDF_RenderContext_Create (FSPDF_RENDERCONTEXT *pdfRenderContext)
 Create a PDF rendering context. More...
 
FS_RESULT FSPDF_RenderContext_Release (FSPDF_RENDERCONTEXT pdfRenderContext)
 Release a PDF rendering context. More...
 
FS_RESULT FSPDF_RenderContext_SetFlags (FSPDF_RENDERCONTEXT pdfRenderContext, FS_DWORD flags)
 Set flags to a rendering context. More...
 
FS_RESULT FSPDF_RenderContext_SetMatrix (FSPDF_RENDERCONTEXT pdfRenderContext, const FSCRT_MATRIX *matrix)
 Set a transformation matrix to a rendering context. More...
 
FS_RESULT FSPDF_RenderContext_SetHalftoneLimit (FSPDF_RENDERCONTEXT pdfRenderContext, FS_INT32 halftoneLimit)
 Set a halftone limit to a rendering context. More...
 
FS_RESULT FSPDF_RenderContext_SetOption (FSPDF_RENDERCONTEXT pdfRenderContext, FS_DWORD option, FS_LPVOID params)
 Set option parameters to a rendering context. More...
 
FS_RESULT FSPDF_RenderContext_SetLayerContext (FSPDF_RENDERCONTEXT pdfRenderContext, FSPDF_LAYERCONTEXT layerContext)
 Set layer context to render context handle. More...
 
FS_RESULT FSPDF_ActionData_Init (FSPDF_ACTIONDATA *actionData)
 Initialize PDF action data. More...
 
FS_RESULT FSPDF_ActionData_Clear (FSPDF_ACTIONDATA *actionData)
 Clear PDF action data. More...
 
FS_RESULT FSPDF_Attachment_Create (FSCRT_DOCUMENT document, FSPDF_ATTACHMENT *attachment)
 Create an attachment object. More...
 
FS_RESULT FSPDF_Attachment_Release (FSCRT_DOCUMENT document, FSPDF_ATTACHMENT attachment)
 Release a attachment object. More...
 
FS_RESULT FSPDF_Attachment_IsEmbedded (FSPDF_ATTACHMENT attachment, FS_BOOL *embedded)
 Check whether an attachment is an embedded file or not. More...
 
FS_RESULT FSPDF_Attachment_GetFileName (FSPDF_ATTACHMENT attachment, FSCRT_BSTR *fileName)
 Get file name of an attachment. More...
 
FS_RESULT FSPDF_Attachment_SetFileName (FSPDF_ATTACHMENT attachment, const FSCRT_BSTR *fileName, FS_BOOL isURL)
 Set the file name of an attachment. More...
 
FS_RESULT FSPDF_Attachment_GetDescription (FSPDF_ATTACHMENT attachment, FSCRT_BSTR *description)
 Get description of an attachment. More...
 
FS_RESULT FSPDF_Attachment_SetDescription (FSPDF_ATTACHMENT attachment, const FSCRT_BSTR *description)
 Set the description of an attachment. More...
 
FS_RESULT FSPDF_Attachment_GetSize (FSPDF_ATTACHMENT attachment, FSCRT_FILESIZE *size)
 Get the size of an attachment. More...
 
FS_RESULT FSPDF_Attachment_GetCreationDateTime (FSPDF_ATTACHMENT attachment, FSCRT_DATETIMEZONE *dt)
 Get creation date and time of an attachment. More...
 
FS_RESULT FSPDF_Attachment_SetCreationDateTime (FSPDF_ATTACHMENT attachment, const FSCRT_DATETIMEZONE *dt)
 Set the creation date and time of an attachment. More...
 
FS_RESULT FSPDF_Attachment_GetModifiedDateTime (FSPDF_ATTACHMENT attachment, FSCRT_DATETIMEZONE *dt)
 Get the last modification date and time of an attachment. More...
 
FS_RESULT FSPDF_Attachment_SetModifiedDateTime (FSPDF_ATTACHMENT attachment, const FSCRT_DATETIMEZONE *dt)
 Set the modification date of an attachment. More...
 
FS_RESULT FSPDF_Attachment_GetCheckSum (FSPDF_ATTACHMENT attachment, FSCRT_BSTR *checksum)
 Get an attachment's checksum. More...
 
FS_RESULT FSPDF_Attachment_SetCheckSum (FSPDF_ATTACHMENT attachment, const FSCRT_BSTR *checksum)
 Set the checksum of an attachment. More...
 
FS_RESULT FSPDF_Attachment_WriteToFile (FSPDF_ATTACHMENT attachment, FSCRT_FILE file)
 Write the attachment data directly into a file. More...
 
FS_RESULT FSPDF_Attachment_GetData (FSPDF_ATTACHMENT attachment, FS_BOOL isRawData, FSCRT_FILE *file)
 Get the attachment data with an asynchronous way. More...
 
FS_RESULT FSPDF_Attachment_SetFile (FSPDF_ATTACHMENT attachment, FSCRT_FILE file)
 Set the file of an attachment. More...
 
FS_RESULT FSPDF_Attachment_GetDocument (FSPDF_ATTACHMENT attachment, FSCRT_DOCUMENT *document)
 Get a document handle related to an attachment. More...
 
FS_RESULT FSPDF_Font_IsEmbedded (FSCRT_DOCUMENT document, FSCRT_FONT font, FS_BOOL *isEmbedded)
 Check whether a font is embedded in a PDF document. More...
 
FS_RESULT FSPDF_Font_GetDict (FSCRT_DOCUMENT document, FSCRT_FONT font, FSPDF_OBJECT *fontDictionary)
 Get the dictionary of a font in a PDF document. More...
 
FS_RESULT FSPDF_Font_IsSupportEmbedded (FSCRT_DOCUMENT document, FSCRT_FONT font, FS_BOOL *isSupported)
 Check whether all features of the font can be embedded to a specific PDF document or not. More...
 

Detailed Description

Header file for PDF Base 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 defines some basic or common support for PDF.
It contains:

  • 1. Initialize or finalize PDF module.
  • 2. Macro definitions for PDF permissions.
  • 3. Other common PDF definitions.
  • 4. PDF rendering context.
  • 5. Destination definitions.
  • 6. Access to trigger actions.
  • 7. Access and modify attachment.
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