PDF Page Objects

Definitions for access to PDF Page Objects, PDF Marked Content, and PDF Layers.
Definitions and functions in this module are included in fpdf_pageobjects_r.h, fpdf_pageobjects_w.h, fpdf_markedcontent_r.h, fpdf_markedcontent_w.h, fpdf_layer_r.h, and fpdf_layer_w.h.
Module: PDFPageObjects
License Identifier: PDFPageObjects/All
Available License Right: Reading/Writing
For License Right Reading, see fpdf_pageobjects_r.h, fpdf_markedcontent_r.h, and fpdf_layer_r.h.
For License Right Writing, see fpdf_pageobjects_w.h, fpdf_markedcontent_w.h, and fpdf_layer_w.h. More...

Classes

struct  FSPDF_LAYER
 Handle type to PDF layer. More...
 
struct  FSPDF_LAYERNODE
 Structure for PDF layer nodes. More...
 
struct  FSPDF_LAYERUSAGE_ZOOMDATA
 Param structure for PDF layer zoom usage. More...
 
struct  FSPDF_LAYERUSAGE_PRINTDATA
 Param structure for PDF layer print usage. More...
 
struct  FSPDF_MARKEDCONTENT
 Handle type to PDF marked-content object. More...
 
struct  FSPDF_PAGEOBJECT
 Handle type to page object. More...
 
struct  FSPDF_PAGEOBJECTS
 Handle type to page objects, which indicates a set of page objects. More...
 
struct  FSPDF_GRAPHSTATE
 Structure for PDF graph states. More...
 
struct  FSPDF_TEXTSTATE
 Structure for PDF text states. More...
 

Functions

FS_RESULT FSPDF_LayerNode_Init (FSPDF_LAYERNODE *layers)
 Helper function to initialize a PDF layer node. More...
 
FS_RESULT FSPDF_LayerNode_Clear (FSPDF_LAYERNODE *layers)
 Helper function to clear a PDF layer node. More...
 
FS_RESULT FSPDF_Doc_EnumLayers (FSCRT_DOCUMENT document, FSPDF_LAYERNODE *layers)
 Enum all PDF Layers. More...
 
FS_RESULT FSPDF_Layer_GetName (FSPDF_LAYER layer, FSCRT_BSTR *name)
 Get the name of a PDF layer. More...
 
FS_RESULT FSPDF_Layer_IsInPage (FSCRT_PAGE page, FSPDF_LAYER layer, FS_BOOL *isInPage)
 Check whether a PDF layer is in a given page or not. More...
 
FS_RESULT FSPDF_Layer_HasIntent (FSPDF_LAYER layer, const FSCRT_BSTR *intent, FS_BOOL *hasIntent)
 Check whether a PDF layer has a specific intent. More...
 
FS_RESULT FSPDF_Layer_GetApplicationUsage (FSPDF_LAYER layer, FS_INT32 usageType, FS_LPVOID param)
 Get the application usage and its parameter of a PDF layer. More...
 
FS_RESULT FSPDF_Layer_EnumeratePageObject (FSPDF_LAYER layer, FSCRT_PAGE page, FSCRT_POSITION *position, FSPDF_PAGEOBJECT *pageObj)
 Enumerate page objects and retrieve a page object which is related with a specific layer. More...
 
FS_RESULT FSPDF_LayerContext_Create (FSCRT_DOCUMENT document, FS_INT32 usType, FSPDF_LAYERCONTEXT *context)
 Create a PDF layer context with a given type. More...
 
FS_RESULT FSPDF_LayerContext_Release (FSPDF_LAYERCONTEXT context)
 Release a PDF layer context. More...
 
FS_RESULT FSPDF_LayerContext_GetDocument (FSPDF_LAYERCONTEXT context, FSCRT_DOCUMENT *document)
 Retrieve a PDF document which owns a PDF layer context. More...
 
FS_RESULT FSPDF_LayerContext_GetUsageType (FSPDF_LAYERCONTEXT context, FS_INT32 *usType)
 Get usage type of a PDF layer context. More...
 
FS_RESULT FSPDF_LayerContext_Reset (FSPDF_LAYERCONTEXT context)
 Reset a PDF layer context. More...
 
FS_RESULT FSPDF_LayerContext_CopyStates (FSPDF_LAYERCONTEXT destContext, FSPDF_LAYERCONTEXT srcContext)
 Copy a PDF layer context state from another PDF layer context. More...
 
FS_RESULT FSPDF_LayerContext_MergeStates (FSPDF_LAYERCONTEXT destContext, FSPDF_LAYERCONTEXT srcContext)
 Merge state from source PDF layer context to destination. More...
 
FS_RESULT FSPDF_LayerContext_IsVisible (FSPDF_LAYERCONTEXT context, FSPDF_LAYER layer, FS_BOOL *visible)
 Check whether a PDF layer is visible or not. More...
 
FS_RESULT FSPDF_LayerContext_SetVisible (FSPDF_LAYERCONTEXT context, FSPDF_LAYER layer, FS_BOOL visible)
 Change the visibility state of a PDF layer. More...
 
FS_RESULT FSPDF_Layer_SetName (FSPDF_LAYER layer, const FSCRT_BSTR *name)
 Set the name of a PDF layer. More...
 
FS_RESULT FSPDF_Doc_SetLayersBaseState (FSCRT_DOCUMENT doc, FS_INT32 state)
 Set the base visible state of PDF layers in the default configuration. More...
 
FS_RESULT FSPDF_Layer_SetApplicationUsage (FSPDF_LAYER layer, FS_INT32 usageType, FS_LPVOID param)
 Set the application usage of a PDF layer. If some events is triggered, the visibility of PDF layer will be switched. More...
 
FS_RESULT FSPDF_Layer_RemoveApplicationUsage (FSPDF_LAYER layer, FS_INT32 usageType)
 Remove the application usage of a PDF layer. If some events is triggered, the visibility of PDF layer will be switched. More...
 
FS_RESULT FSPDF_Doc_AddLayer (FSCRT_DOCUMENT doc, FSCRT_BSTR *layerName, FSPDF_LAYER *layer)
 Add a layer to a PDF document. More...
 
FS_RESULT FSPDF_Layer_Remove (FSPDF_LAYER layer, FS_DWORD options)
 Remove a layer from the document. More...
 
FS_RESULT FSPDF_Layer_SetDefaultState (FSPDF_LAYER layer, FS_BOOL state)
 Set the default visible state of a PDF layer in the default configuration. More...
 
FS_RESULT FSPDF_Layer_AddPageObject (FSPDF_LAYER layer, FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj)
 Add a page object to a PDF layer. More...
 
FS_RESULT FSPDF_Layer_RemovePageObject (FSPDF_LAYER layer, FSPDF_PAGEOBJECT pageObj)
 Remove a page object from a PDF layer. More...
 
FS_RESULT FSPDF_PageObject_GetMarkedContent (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FSPDF_MARKEDCONTENT *mc)
 Get a marked content object from a page object. More...
 
FS_RESULT FSPDF_MarkedContent_CountItems (FSCRT_PAGE page, FSPDF_MARKEDCONTENT mc, FS_INT32 *count)
 Get the count of marked content items in the marked content sequence. More...
 
FS_RESULT FSPDF_MarkedContent_GetTagName (FSCRT_PAGE page, FSPDF_MARKEDCONTENT mc, FS_INT32 index, FSCRT_BSTR *tagName)
 Get the tag name of a specific marked content item. More...
 
FS_RESULT FSPDF_MarkedContent_HasTag (FSCRT_PAGE page, FSPDF_MARKEDCONTENT mc, const FSCRT_BSTR *tagName, FS_BOOL *bHas)
 Check whether a marked content object has a specified marked content item. More...
 
FS_RESULT FSPDF_MarkedContent_GetItemParam (FSCRT_PAGE page, FSPDF_MARKEDCONTENT mc, const FSCRT_BSTR *tagName, FS_INT32 *paramType, FS_LPVOID *param)
 Get a parameter type of a parameter value of a specific marked content item. More...
 
FS_RESULT FSPDF_MarkedContent_AddItem (FSCRT_PAGE page, FSPDF_MARKEDCONTENT mc, const FSCRT_BSTR *tagName, FS_INT32 paramType, FS_LPCVOID param)
 Add a new marked content item to the current marked content object. More...
 
FS_RESULT FSPDF_MarkedContent_DeleteItem (FSCRT_PAGE page, FSPDF_MARKEDCONTENT mc, const FSCRT_BSTR *tagName)
 Delete a specific marked content item from the current marked content sequence. More...
 
FS_RESULT FSPDF_Page_GetPageObjects (FSCRT_PAGE page, FSPDF_PAGEOBJECTS *pageObjs)
 Get page objects in a PDF page. More...
 
FS_RESULT FSPDF_PageObjects_CountObjects (FSCRT_PAGE page, FSPDF_PAGEOBJECTS pageObjs, FS_INT32 typeFilter, FS_INT32 *count)
 Get the count of page objects with specific type. More...
 
FS_RESULT FSPDF_PageObjects_GetObject (FSCRT_PAGE page, FSPDF_PAGEOBJECTS pageObjs, FS_INT32 typeFilter, FS_INT32 index, FSPDF_PAGEOBJECT *pageObj)
 Get a page object from page objects. More...
 
FS_RESULT FSPDF_PageObjects_EnumerateObject (FSCRT_PAGE page, FSPDF_PAGEOBJECTS pageObjs, FS_INT32 typeFilter, FSCRT_POSITION *position, FSPDF_PAGEOBJECT *pageObj)
 Enumerate page objects and retrieve a page object at a given position from page objects. More...
 
FS_RESULT FSPDF_PageObjects_GetObjectIndex (FSCRT_PAGE page, FSPDF_PAGEOBJECTS pageObjs, FSPDF_PAGEOBJECT pageObj, FS_INT32 typeFilter, FS_INT32 *index)
 Get index of a page object. More...
 
FS_RESULT FSPDF_PageObjects_GetObjectAtPos (FSCRT_PAGE page, FSPDF_PAGEOBJECTS pageObjs, FS_INT32 typeFilter, FS_FLOAT x, FS_FLOAT y, FS_FLOAT tolerance, FSPDF_PAGEOBJECT *pageObj)
 Get a page object at a specific point, in PDF page coordinate system. More...
 
FS_RESULT FSPDF_PageObjects_GetObjectListAtPos (FSCRT_PAGE page, FS_INT32 typeFilter, FS_FLOAT x, FS_FLOAT y, FS_FLOAT tolerance, FSCRT_ARRAY *pageObjList)
 Get an array of all page objects at a specific point, in PDF page coordinate system. More...
 
FS_RESULT FSPDF_PageObject_GetType (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FS_INT32 *type)
 Get type of a page object. More...
 
FS_RESULT FSPDF_PageObject_GetRect (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FSCRT_RECTF *rect)
 Get rectangle of a page object. More...
 
FS_RESULT FSPDF_PageObject_GetMatrix (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FSCRT_MATRIX *matrix)
 Get matrix of a page object. More...
 
FS_RESULT FSPDF_PageObject_GetGraphState (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FSPDF_GRAPHSTATE *graphState)
 Get graph states of a page object . More...
 
FS_RESULT FSPDF_PageObject_GetColor (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FS_BOOL isStroke, FS_ARGB *color)
 Get color of a page object. More...
 
FS_RESULT FSPDF_PageObject_GetClipRect (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FSCRT_RECTF *clipRect)
 Get clip rectangle of a page object . More...
 
FS_RESULT FSPDF_PageObject_HasTransparency (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FS_BOOL *hasTransparency)
 Check whether a page object has transparency. More...
 
FS_RESULT FSPDF_PageObject_GetLayers (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FSCRT_ARRAY *layerArray)
 Get all the layers which associate with specific page object. More...
 
FS_RESULT FSPDF_TextObject_GetTextState (FSCRT_PAGE page, FSPDF_PAGEOBJECT textObj, FSPDF_TEXTSTATE *textState)
 Get text states of a text object. More...
 
FS_RESULT FSPDF_TextObject_GetUnicodeString (FSCRT_PAGE page, FSPDF_PAGEOBJECT textObj, FSCRT_BSTR *unicodeStr)
 Get unicode string of a text object. More...
 
FS_RESULT FSPDF_PathObject_GetPathData (FSCRT_PAGE page, FSPDF_PAGEOBJECT pathObj, FSCRT_PATHDATA *pathData)
 Get of path data of a path object . More...
 
FS_RESULT FSPDF_PathObject_GetFillMode (FSCRT_PAGE page, FSPDF_PAGEOBJECT pathObj, FS_INT32 *fillMode)
 Get fill mode of a path object. More...
 
FS_RESULT FSPDF_PathObject_GetStrokeState (FSCRT_PAGE page, FSPDF_PAGEOBJECT pathObj, FS_BOOL *isStroke)
 Get stroke state of a path object. More...
 
FS_RESULT FSPDF_ImageObject_CloneBitmap (FSCRT_PAGE page, FSPDF_PAGEOBJECT imageObj, FSCRT_BITMAP *bitmap)
 Clone a bitmap from an image object. More...
 
FS_RESULT FSPDF_ImageObject_GetColorSpace (FSCRT_PAGE page, FSPDF_PAGEOBJECT imageObj, FS_INT32 *colorspace)
 Get the color space for an image object. More...
 
FS_RESULT FSPDF_ImageObject_GetStream (FSCRT_PAGE page, FSPDF_PAGEOBJECT imageObj, FSPDF_OBJECT *stream)
 Get the image stream of an image object. More...
 
FS_RESULT FSPDF_FormXObject_GetObjects (FSCRT_PAGE page, FSPDF_PAGEOBJECT formXObj, FSPDF_PAGEOBJECTS *pageObjs)
 Get page objects from a Form XObject object. More...
 
FS_RESULT FSPDF_FormXObject_GetStream (FSCRT_PAGE page, FSPDF_PAGEOBJECT formXObj, FSPDF_OBJECT *stream)
 Get the stream of a form XObject. More...
 
FS_RESULT FSPDF_ShadingObject_GetShading (FSCRT_PAGE page, FSPDF_PAGEOBJECT shadingObj, FSPDF_OBJECT *shadingPDFObj)
 Get the PDF shading dictionary or stream object of a shading page object. More...
 
FS_RESULT FSPDF_PageObject_CountClipPath (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FS_INT32 *count)
 Get count of path clip in a page object. More...
 
FS_RESULT FSPDF_PageObject_GetClipPath (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FS_INT32 index, FSCRT_PATHDATA *pathData, FS_INT32 *fillMode)
 Get a path clip from a page object. More...
 
FS_RESULT FSPDF_PageObject_CountClipText (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FS_INT32 *count)
 Get count of text clip in a page object. More...
 
FS_RESULT FSPDF_PageObject_GetClipText (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FS_INT32 index, FSPDF_PAGEOBJECT *textObj)
 Get a text clip from a page object. More...
 
FS_RESULT FSPDF_PageObjects_InsertObject (FSCRT_PAGE page, FSPDF_PAGEOBJECTS pageObjs, FS_INT32 typeFilter, FS_INT32 index, FSPDF_PAGEOBJECT pageObj)
 Insert a page object and it will be automatically freed. More...
 
FS_RESULT FSPDF_PageObjects_RemoveObject (FSCRT_PAGE page, FSPDF_PAGEOBJECTS pageObjs, FSPDF_PAGEOBJECT pageObj)
 Remove a page object. More...
 
FS_RESULT FSPDF_PageObjects_GenerateContents (FSCRT_PAGE page, FSPDF_PAGEOBJECTS pageObjs)
 Generate PDF Page contents. More...
 
FS_RESULT FSPDF_PageObject_Clone (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FSPDF_PAGEOBJECT *clonedPageObj)
 Clone a new page object. More...
 
FS_RESULT FSPDF_PageObject_SetMatrix (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, const FSCRT_MATRIX *matrix)
 Set matrix of a page object. More...
 
FS_RESULT FSPDF_PageObject_Transform (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, const FSCRT_MATRIX *matrix, FS_BOOL needTransformClipPath)
 Transform a page object. More...
 
FS_RESULT FSPDF_PageObject_SetGraphState (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, const FSPDF_GRAPHSTATE *graphState)
 Set graph states of a page object. More...
 
FS_RESULT FSPDF_PageObject_SetColor (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FS_BOOL isStroke, FS_ARGB color)
 Set color of a page object . More...
 
FS_RESULT FSPDF_PageObject_SetClipRect (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, const FSCRT_RECTF *clipRect)
 Set clip rectangle of a page object. More...
 
FS_RESULT FSPDF_TextObject_Create (FSCRT_PAGE page, FSPDF_PAGEOBJECT *textObj)
 Create a new text Object. More...
 
FS_RESULT FSPDF_TextObject_SetTextState (FSCRT_PAGE page, FSPDF_PAGEOBJECT textObj, const FSPDF_TEXTSTATE *textState, FS_BOOL italic, FS_INT32 weight)
 Set text states of a text object. More...
 
FS_RESULT FSPDF_TextObject_SetUnicodeString (FSCRT_PAGE page, FSPDF_PAGEOBJECT textObj, const FSCRT_BSTR *unicodeStr)
 Set unicode string for a text object. More...
 
FS_RESULT FSPDF_PathObject_Create (FSCRT_PAGE page, FSPDF_PAGEOBJECT *pathObj)
 Create a new path object. More...
 
FS_RESULT FSPDF_PathObject_SetPathData (FSCRT_PAGE page, FSPDF_PAGEOBJECT pathObj, FSCRT_PATHDATA pathData)
 Set path data of a path object. More...
 
FS_RESULT FSPDF_PathObject_SetFillMode (FSCRT_PAGE page, FSPDF_PAGEOBJECT pathObj, FS_INT32 fillMode)
 Set fill mode of a path object. More...
 
FS_RESULT FSPDF_PathObject_SetStrokeState (FSCRT_PAGE page, FSPDF_PAGEOBJECT pathObj, FS_BOOL isStroke)
 Set stroke state of a path object. More...
 
FS_RESULT FSPDF_PathObject_ConvertFromTextObject (FSCRT_PAGE page, FSPDF_PAGEOBJECT *convertedObj)
 Convert text object to path object for avoiding print deviation. More...
 
FS_RESULT FSPDF_ImageObject_Create (FSCRT_PAGE page, FSPDF_PAGEOBJECT *imageObj)
 Create an image object. More...
 
FS_RESULT FSPDF_ImageObject_SetBitmap (FSCRT_PAGE page, FSPDF_PAGEOBJECT imageObj, FSCRT_BITMAP bitmap, FSCRT_BITMAP mask)
 Set a bitmap to an image object. More...
 
FS_RESULT FSPDF_ImageObject_SetImage (FSCRT_PAGE page, FSPDF_PAGEOBJECT imageObj, FSCRT_IMAGE image)
 Set an image to an image object. More...
 
FS_RESULT FSPDF_ImageObject_SetImageFromFileName (FSCRT_PAGE page, FSPDF_PAGEOBJECT imageObj, const FSCRT_BSTR *imageFileName, FS_INT32 frameIndexOfImage)
 Set an image to an image object from a specific file path. More...
 
FS_RESULT FSPDF_FormXObject_Create (FSCRT_PAGE page, FSPDF_PAGEOBJECT *formXObj)
 Create a Form XObject object. More...
 
FS_RESULT FSPDF_FormXObject_ExtractAPFromPage (FSCRT_PAGE page, FSPDF_PAGEOBJECT formXObj, FSCRT_PAGE srcPage, FS_BOOL isAnnotsIncluded)
 Extract appearance of contents and annotations from a source page to a Form XObject object. More...
 
FS_RESULT FSPDF_PageObject_AddClipPath (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FSCRT_PATHDATA pathData, FS_INT32 fillMode)
 Add path for clipping to a page object. More...
 
FS_RESULT FSPDF_PageObject_DeleteClipPath (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FS_INT32 index)
 Delete a path for clipping from a page object. More...
 
FS_RESULT FSPDF_PageObject_AddClipText (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FSPDF_PAGEOBJECT textObj)
 Add text for clipping to a page object. More...
 
FS_RESULT FSPDF_PageObject_DeleteClipText (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj, FS_INT32 index)
 Delete a text for clipping from a page object. More...
 
FS_RESULT FSPDF_PageObject_ClearClips (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj)
 Clear all clips from a page object. More...
 
FS_RESULT FSPDF_PageObject_Release (FSCRT_PAGE page, FSPDF_PAGEOBJECT pageObj)
 Release a page object which is created or which is cloned but not inserted into any PDF page. More...
 

Macro definitions of Layer Usage Types.

#define FSPDF_LAYERUSAGETYPE_VIEW   0
 Use for a viewer.
 
#define FSPDF_LAYERUSAGETYPE_DESIGN   1
 Use to represent a document designer's structural organization of artwork.
 
#define FSPDF_LAYERUSAGETYPE_PRINT   2
 Use for printing.
 
#define FSPDF_LAYERUSAGETYPE_EXPORT   3
 Use for exporting.
 
#define FSPDF_LAYERUSAGETYPE_ZOOM   4
 Use for zooming.
 

Macro definitions of Layer base state.

#define FSPDF_LAYER_BASESTATE_ON   0
 The states of all groups are turned ON.
 
#define FSPDF_LAYER_BASESTATE_OFF   1
 The states of all groups are turned OFF.
 
#define FSPDF_LAYER_BASESTATE_UNCHANGED   2
 The states of all groups are left unchanged.
 

Macro Definitions for Marked Content Parameter Types.

#define FSPDF_MARKEDCONTENT_PARAMTYPE_NONE   0
 None parameters.
 
#define FSPDF_MARKEDCONTENT_PARAMTYPE_PROPERTIESDICT   1
 A dictionary is defined by named resource in the "Properties" sub-dictionary of the current resource dictionary.
 
#define FSPDF_MARKEDCONTENT_PARAMTYPE_DIRECTDICT   2
 A dictionary may be written inline in the content stream as a direct object.
 
#define FSPDF_MARKEDCONTENT_PARAMTYPE_MCID   3
 (Reserved)A dictionary contains an MCID entry, which is an integer marked-content identifier that uniquely identifies marked-content sequence within its content stream. More...
 

Macro Definitions for Page Object Type

#define FSPDF_PAGEOBJECT_ALL   0
 Page object for all types.
 
#define FSPDF_PAGEOBJECT_TEXT   1
 Text object.
 
#define FSPDF_PAGEOBJECT_PATH   2
 Path object.
 
#define FSPDF_PAGEOBJECT_IMAGE   3
 Image object.
 
#define FSPDF_PAGEOBJECT_SHADING   4
 Shading object.
 
#define FSPDF_PAGEOBJECT_FORMXOBJECT   5
 Form XObject object.
 

Macro Definitions for Text Rendering Modes

#define FSPDF_TEXTMODE_FILL   0
 Fill text.
 
#define FSPDF_TEXTMODE_STROKE   1
 Stroke text.
 
#define FSPDF_TEXTMODE_FILLSTROKE   2
 Fill, and stroke text.
 
#define FSPDF_TEXTMODE_INVISIBLE   3
 Neither fill nor stroke text (invisible).
 
#define FSPDF_TEXTMODE_FILLCLIP   4
 Fill text and add to path for clipping.
 
#define FSPDF_TEXTMODE_STROKECLIP   5
 Stroke text and add to path for clipping.
 
#define FSPDF_TEXTMODE_FILLSTROKECLIP   6
 Fill, then stroke text and add to path for clipping.
 
#define FSPDF_TEXTMODE_CLIP   7
 Add text to path for clipping.
 

Macro Definitions for Image object Color space

#define FSPDF_IMAGECS_INVALID   0
 Color space: Invalid.
 
#define FSPDF_IMAGECS_DEVICEGRAY   1
 Color space: DeviceGray.
 
#define FSPDF_IMAGECS_DEVICERGB   2
 Color space: DeviceRGB.
 
#define FSPDF_IMAGECS_DEVICECMYK   3
 Color space: DeviceCMYK.
 
#define FSPDF_IMAGECS_CALGRAY   4
 Color space: CalGray.
 
#define FSPDF_IMAGECS_CALRGB   5
 Color space: CalRGB.
 
#define FSPDF_IMAGECS_LAB   6
 Color space: Lab.
 
#define FSPDF_IMAGECS_SEPARATION   8
 Color space: Separation.
 
#define FSPDF_IMAGECS_DEVICEN   9
 Color space: DeviceN.
 
#define FSPDF_IMAGECS_PATTERN   11
 Color space: Pattern.
 
#define FSPDF_IMAGECS_ICCBASED_DEVICEGRAY   12
 Color space: ICCBased.
 
#define FSPDF_IMAGECS_ICCBASED_DEVICERGB   13
 Color space: ICCBased.
 
#define FSPDF_IMAGECS_ICCBASED_DEVICECMYK   14
 Color space: ICCBased.
 

Detailed Description

Definitions for access to PDF Page Objects, PDF Marked Content, and PDF Layers.
Definitions and functions in this module are included in fpdf_pageobjects_r.h, fpdf_pageobjects_w.h, fpdf_markedcontent_r.h, fpdf_markedcontent_w.h, fpdf_layer_r.h, and fpdf_layer_w.h.
Module: PDFPageObjects
License Identifier: PDFPageObjects/All
Available License Right: Reading/Writing
For License Right Reading, see fpdf_pageobjects_r.h, fpdf_markedcontent_r.h, and fpdf_layer_r.h.
For License Right Writing, see fpdf_pageobjects_w.h, fpdf_markedcontent_w.h, and fpdf_layer_w.h.

This module contains following features:

This module contains following features:

Macro Definition Documentation

#define FSPDF_MARKEDCONTENT_PARAMTYPE_MCID   3

(Reserved)A dictionary contains an MCID entry, which is an integer marked-content identifier that uniquely identifies marked-content sequence within its content stream.

Note
MCID is usually an entry of a dictionary object. So this macro definition may not be used; instead, FSPDF_MARKEDCONTENT_PARAMTYPE_PROPERTIESDICT or FSPDF_MARKEDCONTENT_PARAMTYPE_DIRECTDICT is used.

Function Documentation

FS_RESULT FSPDF_Doc_AddLayer ( FSCRT_DOCUMENT  doc,
FSCRT_BSTR layerName,
FSPDF_LAYER *  layer 
)

Add a layer to a PDF document.

Parameters
[in]docHandle to a FSCRT_DOCUMENT object which is a PDF document object. It shall be valid.
[in]layerNamePointer to a FSCRT_BSTR structure which specify the name of form field. It should be a UTF-8 string.
[out]layerHandle to a FSPDF_LAYER object which is a PDF layer.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter doc, layer or layerName NULL.
FSCRT_ERRCODE_FORMAT if parameter layerName is not in UTF-8 format.
FSCRT_ERRCODE_INVALIDLICENSE if current license is not authorized or accessing annotation not allowed.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
FSCRT_ERRCODE_ERROR if fails to add a layer.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • doc: this handle is long-term partially recoverable.
  • layer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Doc_EnumLayers ( FSCRT_DOCUMENT  document,
FSPDF_LAYERNODE layers 
)

Enum all PDF Layers.

Parameters
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It shall be valid.
[out]layersPointer to a FSPDF_LAYERNODE handle that receives PDF Layers.
If there are any errors, it will be set NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter document or layers is NULL.
FSCRT_ERRCODE_INVALIDTYPE if the parameter document is not a valid type of PDF document.
FSCRT_ERRCODE_NOTFOUND if parameter document does not contain any optional content.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
FSCRT_ERRCODE_DATANOTREADY if there are not available data for ASYNC documents.
FSCRT_ERRCODE_ERROR if it fails to enumerate all PDF Layers.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
The output parameter layers is readonly. Do not modify it.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • document: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Doc_SetLayersBaseState ( FSCRT_DOCUMENT  doc,
FS_INT32  state 
)

Set the base visible state of PDF layers in the default configuration.

Parameters
[in]docHandle to a FSCRT_DOCUMENT object which is a PDF document object. It shall be valid.
[in]stateThe state of a PDF layer. Please refer to macro definitions FSPDF_LAYER_BASESTATE_XXX and this should be one of these macros.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter doc is NULL, or parameter state is invalid.
FSCRT_ERRCODE_INVALIDTYPE if parameter doc is not a pdf document.
FSCRT_ERRCODE_INVALIDLICENSE if current license is not authorized or accessing annotation not allowed.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if cannot set the base state.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
When a document is first opened, its optional content groups are assigned a state based on the D (default) configuration dictionary in the OCProperties dictionary:
  1. The value of BaseState is applied to all the groups.
  2. The groups listed in either the ON or OFF array (depending on which one is opposite to BaseState) have their states adjusted.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • doc: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_FormXObject_Create ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT *  formXObj 
)

Create a Form XObject object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[out]formXObjPointer to a FSPDF_PAGEOBJECT handle that receives the newly created Form XObject object. If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page or formXObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or creating Form XObject object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a type of PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • page: this handle is long-term partially recoverable.
  • formXObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_FormXObject_ExtractAPFromPage ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  formXObj,
FSCRT_PAGE  srcPage,
FS_BOOL  isAnnotsIncluded 
)

Extract appearance of contents and annotations from a source page to a Form XObject object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid. Parameter formXObj comes from this page.
[in]formXObjHandle to a FSPDF_PAGEOBJECT object that receives the extracted appearance data of contents and annotations in parameter srcPage. This is returned by function FSPDF_FormXObject_Create.
[in]srcPageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid. The extracted data comes from this source page.
[in]isAnnotsIncludedA boolean value that indicates whether annotations are included when extracting appearance.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, formXObj or srcPage is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or creating Form XObject object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page or srcPage is not a type of PDF page, or parameter formXObject is not a Form XObject object.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • formXObj: this handle is short-term.
  • srcPage: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_FormXObject_GetObjects ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  formXObj,
FSPDF_PAGEOBJECTS *  pageObjs 
)

Get page objects from a Form XObject object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]formXObjHandle to aFSPDF_PAGEOBJECT object which is a Form XObject object. It should be valid.
[out]pageObjsPointer to a FSPDF_PAGEOBJECTS handle that receives the page objects. If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, formXObject or pageObjs is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter formXObject is not a Form XObject object.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • formXObj: this handle is short-term.
  • pageObjs: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_FormXObject_GetStream ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  formXObj,
FSPDF_OBJECT *  stream 
)

Get the stream of a form XObject.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]formXObjHandle to aFSPDF_PAGEOBJECT object which is a form XObject object. It should be valid.
[out]streamPointer to a FSPDF_OBJECT handle that receives the stream of a form XObject. If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, formXObj or stream is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter formXObject is not a Form XObject object.
FSCRT_ERRCODE_NOTFOUND if the object or its stream do not exist. FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • formXObj: this handle is short-term.
  • stream: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_ImageObject_CloneBitmap ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  imageObj,
FSCRT_BITMAP *  bitmap 
)

Clone a bitmap from an image object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]imageObjHandle to a FSPDF_PAGEOBJECT object which is an image object. It should be valid.
[out]bitmapPointer to a FSCRT_BITMAP handle that receives a bitmap. If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, imageObj or bitmap is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter imageObj is not an image object.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or if the memory access is wrong.
FSCRT_ERRCODE_FORMAT if bitmap format of parameter imageObj is invalid.
FSCRT_ERRCODE_ERROR if fail to clone bitmap from an image object for any other reason.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
User must call function FSCRT_Bitmap_Release to destroy the parameter bitmap and release all resources associated when no need to use bitmap any more.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • imageObj: this handle is short-term.
  • bitmap: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_ImageObject_Create ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT *  imageObj 
)

Create an image object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[out]imageObjPointer to a FSPDF_PAGEOBJECT handle that receives the newly created image object. If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page or imageObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or creating image object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a type of PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • page: this handle is long-term partially recoverable.
  • imageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_ImageObject_GetColorSpace ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  imageObj,
FS_INT32 colorspace 
)

Get the color space for an image object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]imageObjHandle to a FSPDF_PAGEOBJECT object which is an image object. It should be valid.
[out]colorspacePointer to a FS_INT32 object that receives colorspace for an image object. Please refer to macro definitions FSPDF_IMAGECS_XXX and this would be one of these macros.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, imageObj or colorspace is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter imageObj is not an image object.
FSCRT_ERRCODE_ERROR if fail to clone bitmap from an image object for any other reason.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • imageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_ImageObject_GetStream ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  imageObj,
FSPDF_OBJECT *  stream 
)

Get the image stream of an image object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]imageObjHandle to a FSPDF_PAGEOBJECT object which is an image object. It should be valid.
[out]streamPointer to a FSPDF_OBJECT object that receives the image stream for an image object.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, imageObj or stream is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter imageObj is not an image object.
FSCRT_ERRCODE_NOTFOUND if the object do not exist. FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • imageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_ImageObject_SetBitmap ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  imageObj,
FSCRT_BITMAP  bitmap,
FSCRT_BITMAP  mask 
)

Set a bitmap to an image object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]imageObjHandle to a FSPDF_PAGEOBJECT object which is an image object. It should be valid.
[in]bitmapHandle to a FSCRT_BITMAP object which is a bitmap object, and it can be returned by function FSCRT_Bitmap_Create or FSCRT_Bitmap_Clone.
[in]maskHandle to a FSCRT_BITMAP object which is a bitmap object for mask, and its format should be FSCRT_BITMAPFORMAT_8BPP_MASK. This is valid only when parameter bitmap does not have an alpha channel. It can be NULL or returned by function FSCRT_Bitmap_Create or FSCRT_Bitmap_Clone.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, imageObj or bitmap is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting bitmap to image object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter imageObj is not an image object.
FSCRT_ERRCODE_UNSUPPORTED if format of parameter mask is not FSCRT_BITMAPFORMAT_8BPP_MASK when mask is valid.
FSCRT_ERRCODE_ERROR if fail to set bitmap to an image object for any other reason.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • imageObj: this handle is short-term.
  • bitmap: this handle is long-term recoverable.
  • mask: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_ImageObject_SetImage ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  imageObj,
FSCRT_IMAGE  image 
)

Set an image to an image object.

Parameter imageObj can be set only one frame, so that caller must call function FSCRT_Image_LoadFrame to load a frame of parameter image which is to be set.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]imageObjHandle to a FSPDF_PAGEOBJECT object which is an image object. It should be valid.
[in]imageHandle to a FSCRT_IMAGE object which is a bitmap object, and it is returned or by function FSCRT_Image_LoadFromFile.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, imageObj or image is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting image to image object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter imageObj is not an image object.
FSCRT_ERRCODE_DATANOTREADY if no frame of parameter image is loaded.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
If callers need to reduce the memory during setting FSCRT_IMAGETYPE_TIF image, please use the function FSPDF_ImageObject_SetImageFromFileName.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • imageObj: this handle is short-term.
  • image: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_ImageObject_SetImageFromFileName ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  imageObj,
const FSCRT_BSTR imageFileName,
FS_INT32  frameIndexOfImage 
)

Set an image to an image object from a specific file path.

The function can optimize the consume of memory for image in type FSCRT_IMAGETYPE_TIF, however, it may reduce the performance a little bit. For other image types, this function is just the same as function FSPDF_ImageObject_SetImage.
Users must not move or remove the image file specified by parameter imageFileName until current document is closed.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]imageObjHandle to a FSPDF_PAGEOBJECT object which is an image object. It should be valid.
[in]imageFileNamePointer to a UTF-8 encoded string that specifies a path of image file. It should be a valid pointer to FSCRT_BSTR.
[in]frameIndexOfImageThe zero-based index of the frame in the image specified by parameter imageFileName. Range: 0 to (FrameCount-1). FrameCount is the count of frames in the image.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, imageObj or imageFileName is NULL pointer or imageFileName is empty.
FSCRT_ERRCODE_NOTFOUND if parameter frameIndexOfImage is out of range.
FSCRT_ERRCODE_FORMAT if the parameter imageFileName is not in UTF-8 format.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting image to image object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter imageObj is not an image object.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
FSCRT_ERRCODE_ERROR if fail to set image to an image object for any other reason.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • imageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Layer_AddPageObject ( FSPDF_LAYER  layer,
FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj 
)

Add a page object to a PDF layer.

Parameters
[in]layerHandle to a FSPDF_LAYER object which is a PDF layer. It shall be valid.
[in]pageHandle to a FSCRT_PAGE object which is a page object.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter layer, pageObj or page is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if it fails to add page object.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
In order to make sure this function works well, the pageObj should be on the page.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • layer: this handle is long-term recoverable.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Layer_EnumeratePageObject ( FSPDF_LAYER  layer,
FSCRT_PAGE  page,
FSCRT_POSITION *  position,
FSPDF_PAGEOBJECT *  pageObj 
)

Enumerate page objects and retrieve a page object which is related with a specific layer.

The type of page object(which is to be got) is specified by parameter typeFilter.

Parameters
[in]layerHandle to a FSPDF_LAYER object which is a PDF layer. It shall be valid.
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in,out]positionPointer to a FSCRT_POSITION object which represents the position of a page object. When this function is called, it represents the position of a page object which is to be retrieved. If call this function for first time, please pass a FSPDF_POSITION object with value NULL , in order to retrieved the first page object.
When this function returns, it will receive the position of next page object. If there is no more page objects to be enumerated, a FSPDF_POSITION object with value -1 will be returned.
[out]pageObjPointer to a FSPDF_PAGEOBJECT handle that receives a specific page object. If there is any error or the enumeration is finished, it will be NULL.
Returns
FSCRT_ERRCODE_TOBECONTINUED if a page object is founded,and it is possible that there will be more.
FSCRT_ERRCODE_FINISHED if no more entries can be retrieved.
FSCRT_ERRCODE_PARAM if parameter layer page, pageObjs ,position or pageObj is a NULL pointer, or typeFilter is invalid.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • layer: this handle is long-term recoverable.
  • page: this handle is long-term partially recoverable.
  • pageObjs: this handle is short-term.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Layer_GetApplicationUsage ( FSPDF_LAYER  layer,
FS_INT32  usageType,
FS_LPVOID  param 
)

Get the application usage and its parameter of a PDF layer.

Parameters
[in]layerHandle to a FSPDF_LAYER object.
[in]usageTypeA FS_INT32 object indicates the type of usage.
It should be one of following macro definitions(not support ::FSPDF_LAYERUSAGETYPE_DESIGN):
[out]paramA pointer to the param of eventType. Its type is decided by usageType:
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter layer is NULL, usageType is out of range or param is NULL.
FSCRT_ERRCODE_UNSUPPORTED if usageType is not supported.
FSCRT_ERRCODE_INVALIDLICENSE if current license is not authorized or accessing annotation not allowed.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if it fails to set usage of a PDF layer.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • layer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Layer_GetName ( FSPDF_LAYER  layer,
FSCRT_BSTR name 
)

Get the name of a PDF layer.

Parameters
[in]layerHandle to a FSPDF_LAYER object which is a PDF layer. It shall be valid.
[out]namePointer to a FSCRT_BSTR structure that receives a layer name. It shall be a UTF-8 string.
If there are any errors, FSCRT_BSTR::str will be set NULL, and FSCRT_BSTR::len will be set 0.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter layer or nameis NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
FSCRT_ERRCODE_ERROR if it fails to get name of a PDF layer.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • layer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Layer_HasIntent ( FSPDF_LAYER  layer,
const FSCRT_BSTR intent,
FS_BOOL hasIntent 
)

Check whether a PDF layer has a specific intent.

Parameters
[in]layerHandle to a FSPDF_LAYER object which is a PDF layer. It shall be valid.
[in]intentPointer to a FSCRT_BSTR structure that specifies the intent name. It shall be a UTF-8 string.
Currently, PDF defines two intent names:"View","Design".
[out]hasIntentPointer to a FS_BOOL object that receives a boolean value which indicates whether a layer has a specific intent
TRUE means it has the intent, while FALSE means not.
If there are any errors, it will be FALSE.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter layer or intent or hasIntent is NULL, or intent is empty.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • layer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Layer_IsInPage ( FSCRT_PAGE  page,
FSPDF_LAYER  layer,
FS_BOOL isInPage 
)

Check whether a PDF layer is in a given page or not.

Parameters
[in]pageHandle to a FSPDF_PAGE object which is a PDF page. It shall be valid
[in]layerHandle to a FSPDF_LAYER object which is a PDF layer. It shall be valid.
[out]isInPagePointer to a FS_BOOL object that receives a boolean value which indicates whether a layer is in a given page or not:
TRUE means in the page, while FALSE means not.
If there are any errors, it will be FALSE.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter page, layer or isInPageis NULL.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a type of PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • page: this handle is long-term recoverable.
  • layer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Layer_Remove ( FSPDF_LAYER  layer,
FS_DWORD  options 
)

Remove a layer from the document.

It will reconstruct the structure of layer tree to remove a layer. Currently, Foxit SDK will remove the sub layers of the layers which is removed.

Parameters
[in]layerHandle to a FSPDF_LAYER object which is a PDF layer.
[in]optionsIndicates how to deal with sub layers. This parameter is reserved, and should be 0.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter doc is NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if current license is not authorized or accessing annotation not allowed.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if cannot remove the layer.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • layer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Layer_RemoveApplicationUsage ( FSPDF_LAYER  layer,
FS_INT32  usageType 
)

Remove the application usage of a PDF layer. If some events is triggered, the visibility of PDF layer will be switched.

Parameters
[in]layerHandle to a FSPDF_LAYER object.
[in]usageTypeA FS_INT32 object indicates the type of usage. It should be one of macro definations below:
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter layers is NULL, or usageType is out of range.
FSCRT_ERRCODE_INVALIDLICENSE if current license is not authorized or accessing annotation not allowed.
FSCRT_ERRCODE_NOTFOUND if layer do not contain this usage specified by usageType.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if it fails to set usage of a PDF layer.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • layer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Layer_RemovePageObject ( FSPDF_LAYER  layer,
FSPDF_PAGEOBJECT  pageObj 
)

Remove a page object from a PDF layer.

Parameters
[in]layerHandle to a FSPDF_LAYER object which is a PDF layer. It shall be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter layer or pageObj is NULL.
FSCRT_ERRCODE_NOTFOUND if pageObj is not in the layer.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if it fails to remove a page object.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • layer: this handle is long-term recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Layer_SetApplicationUsage ( FSPDF_LAYER  layer,
FS_INT32  usageType,
FS_LPVOID  param 
)

Set the application usage of a PDF layer. If some events is triggered, the visibility of PDF layer will be switched.

Parameters
[in]layerHandle to a FSPDF_LAYER object.
[in]usageTypeA FS_INT32 object indicates the type of usage.
It should be one of macro definations below(not support ::FSPDF_LAYERUSAGETYPE_DESIGN):
[out]paramA pointer to the param of eventType. Its type is decided by usageType:
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter layer is NULL, usageType is out of range, or param is invalid.
FSCRT_ERRCODE_INVALIDLICENSE if current license is not authorized or accessing annotation not allowed.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if it fails to set usage of a PDF layer.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • layer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Layer_SetDefaultState ( FSPDF_LAYER  layer,
FS_BOOL  state 
)

Set the default visible state of a PDF layer in the default configuration.

Parameters
[in]layerHandle to a FSPDF_LAYER object which is a PDF layer.
[in]stateA boolean value that indicate the default status(TRUE for visible, FALSE for invisible) of a PDF layer in the document.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter doc is NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if current license is not authorized or accessing annotation not allowed.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if cannot set the default state.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • layer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Layer_SetName ( FSPDF_LAYER  layer,
const FSCRT_BSTR name 
)

Set the name of a PDF layer.

Parameters
[in]layerHandle to a FSPDF_LAYER object which is a PDF layer. It should be valid.
[in]namePointer to a FSCRT_BSTR structure that specifies a layer name. It should be a valid UTF-8 string.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter layer or name is NULL pointer or name is empty.
FSCRT_ERRCODE_FORMAT if parameter name is not in UTF-8 format.
FSCRT_ERRCODE_INVALIDLICENSE if current license is not authorized or accessing layer not allowed.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
FSCRT_ERRCODE_ERROR if it fails to set name of a PDF layer.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • layer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_LayerContext_CopyStates ( FSPDF_LAYERCONTEXT  destContext,
FSPDF_LAYERCONTEXT  srcContext 
)

Copy a PDF layer context state from another PDF layer context.

Parameters
[in]destContextHandle to a FSPDF_LAYERCONTEXT object which is the destination PDF layer context.
[in]srcContextHandle to a FSPDF_LAYERCONTEXT object which is the source PDF layer context.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter destContext or srcContext is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if it fails to copy the state of layer context.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
The function will not change the usage type of the destination PDF layer context.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • destContext: this handle is long-term partially recoverable.
  • srcContext: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_LayerContext_Create ( FSCRT_DOCUMENT  document,
FS_INT32  usType,
FSPDF_LAYERCONTEXT *  context 
)

Create a PDF layer context with a given type.

Parameters
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid.
[in]usTypePointer to a FS_INT32 object indicating usage type.
It should be one of the following macro definitions (not support FSPDF_LAYERUSAGETYPE_ZOOM):
[out]contextPointer to a FSPDF_LAYERCONTEXT handle that receives a PDF layer context.
If there are any errors, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM when parameter document or contextis NULL, or usType is invalid.
FSCRT_ERRCODE_INVALIDTYPE if parameter document is not a valid type of PDF document.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or incorrect memory access.
FSCRT_ERRCODE_DATANOTREADY if there are not available data for asynchronous documents.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Function FSPDF_LayerContext_Release is required to be called to release a context when it is not used anymore.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • document: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_LayerContext_GetDocument ( FSPDF_LAYERCONTEXT  context,
FSCRT_DOCUMENT *  document 
)

Retrieve a PDF document which owns a PDF layer context.

Parameters
[in]contextHandle to a FSPDF_LAYERCONTEXT object which is a PDF layer context.
[out]documentPointer to a FSCRT_DOCUMENT handle that receives a PDF document. If there are any errors, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter context, or document is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • context: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_LayerContext_GetUsageType ( FSPDF_LAYERCONTEXT  context,
FS_INT32 usType 
)

Get usage type of a PDF layer context.

Parameters
[in]contextHandle to a FSPDF_LAYERCONTEXT object which is a PDF layer context.
[out]usTypePointer to a FS_INT32 object that receives a usage type.
It would be one of the following macro definitions (not support FSPDF_LAYERUSAGETYPE_ZOOM):
If there are any errors, it will be -1.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter context or usTypeis NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • context: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_LayerContext_IsVisible ( FSPDF_LAYERCONTEXT  context,
FSPDF_LAYER  layer,
FS_BOOL visible 
)

Check whether a PDF layer is visible or not.

Parameters
[in]contextHandle to a FSPDF_LAYERCONTEXT object which is PDF layer context.
[in]layerHandle to a FSPDF_LAYER object which is a PDF layer. It shall be valid.
[out]visiblePointer to a FS_BOOL object that receives a boolean value which indicates whether a layer is visible or not:
TRUE means visible, or FALSE means not.
If there are any errors, it will be FALSE.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter context, layer or visibleis NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • context: this handle is long-term partially recoverable.
  • layer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_LayerContext_MergeStates ( FSPDF_LAYERCONTEXT  destContext,
FSPDF_LAYERCONTEXT  srcContext 
)

Merge state from source PDF layer context to destination.

Parameters
[in]destContextHandle to a FSPDF_LAYERCONTEXT object which is the destination PDF layer context.
[in]srcContextHandle to a FSPDF_LAYERCONTEXT object which is the source PDF layer context. It should be a different usage type with parameter destContext.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter destContext or srcContext is NULL.
FSCRT_ERRCODE_INVALIDTYPE if the usage type of parameter srcContext is the same as destContext's.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
The function does not change the usage type of the destination PDF layer context, and only OFF layers in context will be merged.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • destContext: this handle is long-term partially recoverable.
  • srcContext: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_LayerContext_Release ( FSPDF_LAYERCONTEXT  context)

Release a PDF layer context.

Parameters
[in]contextHandle to a FSPDF_LAYERCONTEXT object which is a PDF layer context.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter context is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if the PDF document which is parameter context belongs to is invalid.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • context: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_LayerContext_Reset ( FSPDF_LAYERCONTEXT  context)

Reset a PDF layer context.

Parameters
[in]contextHandle to a FSPDF_LAYERCONTEXT object which is a PDF layer context.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter context is NULL.
FSCRT_ERRCODE_ERROR if it fails to reset a PDF layer context.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • context: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_LayerContext_SetVisible ( FSPDF_LAYERCONTEXT  context,
FSPDF_LAYER  layer,
FS_BOOL  visible 
)

Change the visibility state of a PDF layer.

Parameters
[in]contextHandle to a FSPDF_LAYERCONTEXT object which is a PDF layer context.
[in]layerHandle to a FSPDF_LAYER object which is a PDF layer. It shall be valid.
[in]visibleA FS_BOOL value which represents the visibility state of PDF layer:
TRUE means visible, while FALSE means not.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if a parameter context or layeris NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if it fails to change PDF layer visibility state.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is thread safe. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • context: this handle is long-term partially recoverable.
  • layer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_LayerNode_Clear ( FSPDF_LAYERNODE layers)

Helper function to clear a PDF layer node.

Parameters
[in]layersPointer to a FSPDF_LAYERNODE structure which will be cleared.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter layers or bstr of FSPDF_LAYERNODE::name is NULL.
FSCRT_ERRCODE_ERROR if it fails to clear a PDF layer node.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
This helper function is used to clear data in a FSPDF_LAYERNODE object when no need to use it any more.
Attention
Thread Safety: this function is not thread safe. Applications need to make sure thread safety by themselves when accessing the same objects during multi-thread environments. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_LayerNode_Init ( FSPDF_LAYERNODE layers)

Helper function to initialize a PDF layer node.

Parameters
[in]layersPointer to a FSPDF_LAYERNODE structure which will be initialized.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if a parameter layers or bstr of FSPDF_LAYERNODE::name is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
This helper function is used to initialize a layer node variable.
It sets FSCRT_BSTR::str to NULL, FSCRT_BSTR::len to 0 of FSPDF_LAYERNODE::name, FSPDF_LAYERNODE::layer and FSPDF_LAYERNODE::children to NULL and FSPDF_LAYERNODE::count to 0.
Attention
Thread Safety: this function is not thread safe. Applications need to make sure thread safety by themselves when accessing the same objects during multi-thread environments. OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_MarkedContent_AddItem ( FSCRT_PAGE  page,
FSPDF_MARKEDCONTENT  mc,
const FSCRT_BSTR tagName,
FS_INT32  paramType,
FS_LPCVOID  param 
)

Add a new marked content item to the current marked content object.

A marked content object may be nested one within another, and this function is used to add a new marked content item to the current marked content object associated with the current page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]mcHandle to a FSPDF_MARKEDCONTENT object which is a marked content object.
[in]tagNamePointer to a FSCRT_BSTR structure to specify value of the tag name. It should be a UTF-8 string.
[in]paramTypePointer to FS_INT32 object that specifies a parameter type. Please refer to macro definitions FSPDF_MARKEDCONTENT_PARAMTYPE_XXX and this should be one of these macros except FSPDF_MARKEDCONTENT_PARAMTYPE_MCID.
Also check comments of the parameter param and note part for more details.
[in]paramPointer to FS_LPVOID object that specifies a parameter value.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or adding marked content item is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if the parameter page is an invalid type, or if the parameter param is not a valid PDF dictionary type when the parameter paramType is FSPDF_MARKEDCONTENT_PARAMTYPE_DIRECTDICT or FSPDF_MARKEDCONTENT_PARAMTYPE_PROPERTIESDICT.
FSCRT_ERRCODE_FORMAT if it is not a UTF-8 byte string in parameter tagName.
FSCRT_ERRCODE_CONFLICT if the parameter tagName has already existing in items of the current marked content object.
FSCRT_ERRCODE_ERROR if fail to add a new marked content item for any other reasons.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
FSPDF_MARKEDCONTENT_PARAMTYPE_MCID cannot be used in this method, since a MCID identifier should be an entry in a marked-content reference dictionary. So when an application needs to set MCID, the parameter paramType should be either FSPDF_MARKEDCONTENT_PARAMTYPE_PROPERTIESDICT or FSPDF_MARKEDCONTENT_PARAMTYPE_DIRECTDICT. This application shall set MCID value in its dictionary entry.
Marked content is a part of page object. So after adding an item to marked content, applications should call the function FSPDF_PageObjects_GenerateContents before saving a page to a file or reloading a page, otherwise all changes on page objects will be lost.
Attention
Thread Safety: this function is not thread safe. Applications need to make sure thread safety by themselves when accessing the same objects during multi-thread environments.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • mc: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_MarkedContent_CountItems ( FSCRT_PAGE  page,
FSPDF_MARKEDCONTENT  mc,
FS_INT32 count 
)

Get the count of marked content items in the marked content sequence.

A marked content object may be nested one within another, and this function is used to get the count of marked content items in the current marked content sequence.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]mcHandle to a FSPDF_MARKEDCONTENT object which is a marked content object.
[out]countPointer to a FS_INT32 object that receives count of marked content items.
If there are any errors, it shall be set 0.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if the parameter page, mc or count is NULL.
FSCRT_ERRCODE_INVALIDTYPE if the parameter page is an invalid type.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Applications need to make sure thread safety by themselves when accessing the same objects during multi-thread environments.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • mc: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_MarkedContent_DeleteItem ( FSCRT_PAGE  page,
FSPDF_MARKEDCONTENT  mc,
const FSCRT_BSTR tagName 
)

Delete a specific marked content item from the current marked content sequence.

A marked content object may be nested one within another, and this function is used to delete a specific marked content item from current marked content sequence.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]mcHandle to a FSPDF_MARKEDCONTENT object which is a marked content object.
[in]tagNamePointer to a FSCRT_BSTR structure to specify value of the tag name. It should be a UTF-8 string.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if the parameter page, mc or tagName is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or deleting marked content item is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if the parameter page is invalid type.
FSCRT_ERRCODE_FORMAT if it is not a UTF-8 byte string in the parameter tagName.
FSCRT_ERRCODE_ERROR if fail to delete a specific marked content item for any other reasons.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Marked content is a part of page objects. So after deleting an item from marked content, applications should call the function FSPDF_PageObjects_GenerateContents before saving a page to a file or reloading a page, otherwise all changes on page objects will be lost.
Attention
Thread Safety: this function is not thread safe. Applications need to make sure thread safety by themselves when accessing the same objects during multi-thread environments.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • mc: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_MarkedContent_GetItemParam ( FSCRT_PAGE  page,
FSPDF_MARKEDCONTENT  mc,
const FSCRT_BSTR tagName,
FS_INT32 paramType,
FS_LPVOID param 
)

Get a parameter type of a parameter value of a specific marked content item.

A marked content object may be nested one within another, and this function is used to get the parameter type and its value of a specific marked content item in the current marked content sequence.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]mcHandle to a FSPDF_MARKEDCONTENT object which is a marked content object.
[in]tagNamePointer to a FSCRT_BSTR structure to specify value of the tag name. It should be a UTF-8 string.
[out]paramTypePointer to FS_INT32 object that receives a parameter type.
Please refer to macro definitions FSPDF_MARKEDCONTENT_PARAMTYPE_XXX and this would be one of these macros.
If there are any errors, it will be set -1.
[out]paramPointer to FS_LPVOID object that receives the parameter value. If there is any error, it will be set NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if the parameter page, mc, tagName, paramType or param is NULL.
FSCRT_ERRCODE_INVALIDTYPE if the parameter page is invalid type.
FSCRT_ERRCODE_FORMAT if it is not a UTF-8 byte string in parameter tagName.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Applications need to make sure thread safety by themselves when accessing the same objects during multi-thread environments.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • mc: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_MarkedContent_GetTagName ( FSCRT_PAGE  page,
FSPDF_MARKEDCONTENT  mc,
FS_INT32  index,
FSCRT_BSTR tagName 
)

Get the tag name of a specific marked content item.

A marked content object may be nested one within another, and this function is used to get tag name of a specific marked content item in the current marked content sequence.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]mcHandle to a FSPDF_MARKEDCONTENT object which is a marked content object.
[in]indexThe index of the marked content item. Range: 0 to (itemcount-1). itemcount is returned by the function FSPDF_MarkedContent_CountItems.
[out]tagNamePointer to a FSCRT_BSTR structure (a UTF-8 string) that receives value of tag name.
If there are any errors, FSCRT_BSTR::str will be set empty if it is not NULL, and FSCRT_BSTR::len will be set 0.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if the parameter page, mc or tagName is NULL.
FSCRT_ERRCODE_INVALIDTYPE if the parameter page is an invalid type.
FSCRT_ERRCODE_NOTFOUND if the parameter index is out of range.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Applications need to make sure thread safety by themselves when accessing the same objects during multi-thread environments.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • mc: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_MarkedContent_HasTag ( FSCRT_PAGE  page,
FSPDF_MARKEDCONTENT  mc,
const FSCRT_BSTR tagName,
FS_BOOL bHas 
)

Check whether a marked content object has a specified marked content item.

A marked content object may be nested one within another, and this function is used to check whether a marked content object has a specified marked content item in the current marked content sequence.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]mcHandle to a FSPDF_MARKEDCONTENT object which is a marked content object.
[in]tagNamePointer to a FSCRT_BSTR structure to specify value of the tag name. It should be a UTF-8 string.
[out]bHasPointer to a FS_BOOL object that receives a boolean value which specifies whether there is a marked content item with the specific tag name.
If there are any errors, it will be FALSE.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if the parameter page, mc, tagName or bHas is NULL.
FSCRT_ERRCODE_INVALIDTYPE if the parameter page is invalid type.
FSCRT_ERRCODE_FORMAT if it is not a UTF-8 byte string in the parameter tagName.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Applications need to make sure thread safety by themselves when accessing the same objects during multi-thread environments.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • mc: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_Page_GetPageObjects ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECTS *  pageObjs 
)

Get page objects in a PDF page.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[out]pageObjsPointer to a FSPDF_PAGEOBJECTS handle that receives page objects.
If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page or pageObjs is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or get page objects is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_NOTPARSED if parameter page has not been parsed.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
To call this function, parameter page should be parsed. Please refer to function FSPDF_Page_StartParse for how to parse a PDF page.
Attention
Thread Safety: this function is thread safe.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • page: this handle is long-term partially recoverable.
  • pageObjs: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_AddClipPath ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FSCRT_PATHDATA  pathData,
FS_INT32  fillMode 
)

Add path for clipping to a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[in]pathDataHandle to a FSCRT_PATHDATA object to be set.
[in]fillModePlease refer to macro definitions FSCRT_FILLMODE_XXX and this should be one of these macros.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj, pathData is a NULL pointer.
,or fillMode is invalid.
. FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or adding clip path to page object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_AddClipText ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FSPDF_PAGEOBJECT  textObj 
)

Add text for clipping to a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[in]textObjHandle to a FSPDF_PAGEOBJECT object which is a text object. It should be valid.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObjor textObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or adding text clip to page object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
  • textObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_ClearClips ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj 
)

Clear all clips from a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page or pageObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or clearing all clip from page object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_Clone ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FSPDF_PAGEOBJECT *  clonedPageObj 
)

Clone a new page object.

Newly cloned page object is related to input PDF page. So it can only be used inside the document which contains the input page.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[out]clonedPageObjPointer to a FSPDF_PAGEOBJECT handle that receives a cloned page object. If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or clonedPageObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or cloning page object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
  • clonePageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_CountClipPath ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FS_INT32 count 
)

Get count of path clip in a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[out]countPointer to a FS_INT32 object that receives count of path clips. If there is any error, it will be set 0.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or count is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_CountClipText ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FS_INT32 count 
)

Get count of text clip in a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[out]countPointer to a FS_INT32 object that receives count of text clips. If there is any error, it will be 0.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or count is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_DeleteClipPath ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FS_INT32  index 
)

Delete a path for clipping from a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[in]indexIndex of path to be deleted. Range: 0 to (pathcount-1). pathcount is returned by function FSPDF_PageObject_CountClipPath.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObjs or pageObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or deleting clip path from page object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_NOTFOUND if parameter index is out of range or there is no path clip associated to pageObj.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_DeleteClipText ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FS_INT32  index 
)

Delete a text for clipping from a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[in]indexIndex of path to be deleted. Range: 0 to (pathcount-1). pathcount is returned by function FSPDF_PageObject_CountClipText.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page or pageObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or deleting text clip from page object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_NOTFOUND if parameter index is out of range or there is no text clip associated to pageObj.
FSCRT_ERRCODE_ERROR if failed to delete text clip from the page object for any other reason.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_GetClipPath ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FS_INT32  index,
FSCRT_PATHDATA *  pathData,
FS_INT32 fillMode 
)

Get a path clip from a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[in]indexIndex of path clip. Range: 0 to (clippathcount-1). clippathcount is returned by function FSPDF_PageObject_CountClipPath.
[out]pathDataPointer to a FSCRT_PATHDATA handle that receives path data. If there is any error, path data will be cleared and count of points will be 0.
[out]fillModePointer to a FS_INT32 object that receives the fill mode. Please refer to macro definitions FSCRT_FILLMODE_XXX and this would be one of these macros.
If there is any error, it will be set FSCRT_FILLMODE_NONE.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj, pathData or fillMode is a NULL pointer. FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_NOTFOUND if parameter index is out of range, or there is no path clip associated to pageObj.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_GetClipRect ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FSCRT_RECTF clipRect 
)

Get clip rectangle of a page object .

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[out]clipRectPointer to a FSCRT_RECTF structure that receives the clip rect. If there is any error, it will be [0 0 0 0].
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or clipRect is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_NOTFOUND if there is no clipping rectangle associated to parameter pageObj.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_GetClipText ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FS_INT32  index,
FSPDF_PAGEOBJECT *  textObj 
)

Get a text clip from a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[in]indexIndex of clip text. Range: 0 to (textclipcount-1). textclipcount is returned by function FSPDF_PageObject_CountClipText.
[out]textObjPointer to a FSPDF_PAGEOBJECT handle that receives a specific text page object. If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or textObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_NOTFOUND if parameter index is out of range, or there is no text clip associated to parameter pageObj.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
  • textObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_GetColor ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FS_BOOL  isStroke,
FS_ARGB color 
)

Get color of a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[in]isStrokeA FS_BOOL indicates to get stroke color if TRUE, or to get fill color if FALSE.
[out]colorPointer to a FS_ARGB object that receives color. Format: 0xAARRGGBB.
If there is any error, it will be 0.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or color is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_GetGraphState ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FSPDF_GRAPHSTATE graphState 
)

Get graph states of a page object .

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[out]graphStatePointer to a FSPDF_GRAPHSTATE structure that receives the graph state.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or graphState is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_GetLayers ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FSCRT_ARRAY layerArray 
)

Get all the layers which associate with specific page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjPointer to a FSPDF_PAGEOBJECT handle that receives a specific page object. If there is any error, it will be NULL.
[out]layerArrayPointer to a FSCRT_ARRAY object which recieves the layers.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj, layerArray is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_NOTFOUND if no layer is found.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
  • layerArray: this handle is long-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_GetMarkedContent ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FSPDF_MARKEDCONTENT *  mc 
)

Get a marked content object from a page object.

This function is used to get a marked content object from a specific page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object.
[out]mcPointer to a FSPDF_MARKEDCONTENT handle that receives a marked content object. If there is any errors, this shall be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or getting page objects is not allowed.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or mc is NULL.
FSCRT_ERRCODE_INVALIDTYPE if the parameter page is an invalid type.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Applications need to make sure thread safety by themselves when accessing the same objects during multi-thread environments.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
  • mc: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_GetMatrix ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FSCRT_MATRIX matrix 
)

Get matrix of a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[out]matrixPointer to a FSCRT_MATRIX structure that receives matrix of pageObj. If there is any error, it will be set [1 0 0 1 0 0].
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or matrix is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter pageObj has an invalid page object type.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_GetRect ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FSCRT_RECTF rect 
)

Get rectangle of a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[out]rectPointer to a FSCRT_RECTF structure that receives the rect. If there is any error, it will be [0 0 0 0].
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or rect is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_GetType ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FS_INT32 type 
)

Get type of a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[out]typePointer to a FS_INT32 object that receives the type. Please refer to macro definitions FSPDF_PAGEOBJECT_XXX and this would be one of these macros.
If there is any error, it will be set -1.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or type is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_HasTransparency ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FS_BOOL hasTransparency 
)

Check whether a page object has transparency.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[out]hasTransparencyPointer to a FS_BOOL object that receives a boolean value which indicates whether pageObj has transparency:
  • TRUE: parameter pageObj has transparency.
  • FALSE: parameter pageObj has no transparency..
If there is any error, it will be set FALSE.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or hasTransparency is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_Release ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj 
)

Release a page object which is created or which is cloned but not inserted into any PDF page.

This function is used to release page objects which are created by functions FSPDF_TextObject_Create, FSPDF_PathObject_Create, FSPDF_ImageObject_Create, FSPDF_FormXObject_Create, or FSPDF_PageObject_Clone, but not be inserted to PDF page.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page or pageObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_SetClipRect ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
const FSCRT_RECTF clipRect 
)

Set clip rectangle of a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[in]clipRectPointer to a FSCRT_RECTF structure of clip rectangle to be set.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page or pageObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting page object clip rectangle is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_SetColor ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
FS_BOOL  isStroke,
FS_ARGB  color 
)

Set color of a page object .

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[in]isStrokeA FS_BOOL to set stroke color if TRUE, or to set fill color if FALSE.
[in]colorA FS_ARGB is to be set. Format: 0xAARRGGBB.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting page object color is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Set stroke color will not take effect if the textMode of FSPDF_TEXTSTATE is FSPDF_TEXTMODE_FILL when the pageObj is a text object.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_SetGraphState ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
const FSPDF_GRAPHSTATE graphState 
)

Set graph states of a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[in]graphStatePointer to a FSPDF_GRAPHSTATE structure to be set.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or graphState is a NULL pointer, or if FSPDF_GRAPHSTATE::dashCount of parameter graphState is not between 0 and 16.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting page object graph states is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_SetMatrix ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
const FSCRT_MATRIX matrix 
)

Set matrix of a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
If it is a text object, matrix of this object can be set only if it has a font.
[in]matrixPointer to a FSCRT_MATRIX structure object to be set.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or matrix is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting page object matrix is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter pageObj does not have a valid page object type.
FSCRT_ERRCODE_UNKNOWNSTATE if parameter pageObj is a text object but has no font.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObject_Transform ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pageObj,
const FSCRT_MATRIX matrix,
FS_BOOL  needTransformClipPath 
)

Transform a page object.

Note
After call this function, caller might need call function FSPDF_PageObjects_GenerateContents to generate its contents, Or the change of page object could not be saved to document.
Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
If it is a text object, matrix of this object can be set only if it has a font.
[in]matrixPointer to a FSCRT_MATRIX structure object.
[in]needTransformClipPathA FS_BOOL to indicate whether to transform the clip path with page object, or transform the page object only.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObj or matrix is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting page object matrix is not allowed.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term unrecoverable.
  • page: this handle is long-term partially recoverable.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObjects_CountObjects ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECTS  pageObjs,
FS_INT32  typeFilter,
FS_INT32 count 
)

Get the count of page objects with specific type.

Count all page objects if parameter typeFilter is FSPDF_PAGEOBJECT_ALL.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjsHandle to a FSPDF_PAGEOBJECTS object which is the page objects. It should be valid.
[in]typeFilterA filter flag which specifies what type of page objects is to be counted out. Please refer to macro definitions FSPDF_PAGEOBJECT_XXX and this should be one of these macros.
[out]countPointer to a FS_INT32 object that receives count of specific type. If there is any error, it will be 0.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObjs or count is a NULL pointer, or typeFilter is invalid.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Parameter pageObjs is returned by function FSPDF_Page_GetPageObjects or FSPDF_FormXObject_GetObjects.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObjs: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObjects_EnumerateObject ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECTS  pageObjs,
FS_INT32  typeFilter,
FSCRT_POSITION *  position,
FSPDF_PAGEOBJECT *  pageObj 
)

Enumerate page objects and retrieve a page object at a given position from page objects.

The type of page object(which is to be got) is specified by parameter typeFilter.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjsHandle to a FSPDF_PAGEOBJECTS object which is the page objects. It should be valid.
[in]typeFilterA filter flag for the type of page objects. Please refer to macro definitions FSPDF_PAGEOBJECT_XXX and this should be one of these macros.
[in,out]positionPointer to a FSCRT_POSITION object which represents the position of a page object. When this function is called, it represents the position of a page object which is to be retrieved. If call this function for first time, please pass a FSPDF_POSITION object with value NULL , in order to retrieved the first page object.
When this function returns, it will receive the position of next page object. If there is no more page objects to be enumerated, a FSPDF_POSITION object with value -1 will be returned.
[out]pageObjPointer to a FSPDF_PAGEOBJECT handle that receives a specific page object. If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_TOBECONTINUED if a page object is founded,and it is possible that there will be more.
FSCRT_ERRCODE_FINISHED if no more entries can be retrieved.
FSCRT_ERRCODE_PARAM if parameter page, pageObjs ,position or pageObj is a NULL pointer, or typeFilter is invalid.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObjs: this handle is short-term.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObjects_GenerateContents ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECTS  pageObjs 
)

Generate PDF Page contents.

Application must call this function before saving the page to a file or reload the page, otherwise all changes to the page objects will be lost. If application wants to render page after generating its content, please call function FSPDF_Page_StartParse to re-parse the PDF page before rendering.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjsHandle to a FSPDF_PAGEOBJECTS object which is the page objects. It should be valid.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page or pageObjs is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or generating content is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_ERROR if fail to generate content of page objects for any other reason.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObjs: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObjects_GetObject ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECTS  pageObjs,
FS_INT32  typeFilter,
FS_INT32  index,
FSPDF_PAGEOBJECT *  pageObj 
)

Get a page object from page objects.

The type of page object(which is to be got) is specified by parameter typeFilter. If parameter typeFilter is FSPDF_PAGEOBJECT_ALL, parameter index is of all page objects.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjsHandle to a FSPDF_PAGEOBJECTS object which is the page objects. It should be valid.
[in]typeFilterA filter flag for the type of page objects. Please refer to macro definitions FSPDF_PAGEOBJECT_XXX and this should be one of these macros.
[in]indexIndex of page object. Range: 0 to (objcount-1). objcount is returned by function FSPDF_PageObjects_CountObjects.
[out]pageObjPointer to a FSPDF_PAGEOBJECT handle that receives a specific page object. If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObjs or pageObj is a NULL pointer, or typeFilter is invalid.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_NOTFOUND if parameter index is out of range.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObjs: this handle is short-term.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObjects_GetObjectAtPos ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECTS  pageObjs,
FS_INT32  typeFilter,
FS_FLOAT  x,
FS_FLOAT  y,
FS_FLOAT  tolerance,
FSPDF_PAGEOBJECT *  pageObj 
)

Get a page object at a specific point, in PDF page coordinate system.

Get any type page object if parameter typeFilter is FSPDF_PAGEOBJECT_ALL at the point.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjsHandle to a FSPDF_PAGEOBJECTS object which is the page objects. It should be valid.
[in]typeFilterA filter flag for the type of page objects. Please refer to macro definitions FSPDF_PAGEOBJECT_XXX and this should be one of these macros.
[in]xX position in PDF page coordinate system.
[in]yY position in PDF page coordinate system.
[in]toleranceTolerance value for a page object hit detection, in point units. It should not be a negative.
[out]pageObjPointer to a FSPDF_PAGEOBJECT handle that receives a specific page object. If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObjs or pageObj is a NULL pointer, or typeFilter is invalid, or tolerance is negative value.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_NOTFOUND if no page object is at the specified position.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObjs: this handle is short-term.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObjects_GetObjectIndex ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECTS  pageObjs,
FSPDF_PAGEOBJECT  pageObj,
FS_INT32  typeFilter,
FS_INT32 index 
)

Get index of a page object.

If parameter typeFilter is FSPDF_PAGEOBJECT_ALL, parameter index is of all page objects.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjsHandle to a FSPDF_PAGEOBJECTS object which is the page objects. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
[in]typeFilterA filter flag for the type of page objects. Please refer to macro definitions FSPDF_PAGEOBJECT_XXX and this should be one of these macros.
[out]indexPointer to a FS_INT32 object that receives the index, which is zero-based. If there is any error, it will be -1.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_NOTFOUND if no page object within specific filter is found.
FSCRT_ERRCODE_PARAM if parameter page, pageObjs, pageObj or index is a NULL pointer, or typeFilter is invalid.
FSCRT_ERRCODE_FORMAT if type of parameter pageObj does not match parameter typeFilter.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObjs: this handle is short-term.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObjects_GetObjectListAtPos ( FSCRT_PAGE  page,
FS_INT32  typeFilter,
FS_FLOAT  x,
FS_FLOAT  y,
FS_FLOAT  tolerance,
FSCRT_ARRAY pageObjList 
)

Get an array of all page objects at a specific point, in PDF page coordinate system.

Get any kind of page object if parameter typeFilter is FSPDF_PAGEOBJECT_ALL at the point.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]typeFilterA filter flag for the type of page objects. Please refer to macro definitions FSPDF_PAGEOBJECT_XXX and this should be one of these macros.
[in]xX position in PDF page coordinate system.
[in]yY position in PDF page coordinate system.
[in]toleranceTolerance value for a page object hit detection, in point units. It should not be a negative.
[out]pageObjListPointer to a FSCRT_ARRAY structure that receives specific page objects whose handle is FSPDF_PAGEOBJECT. Application should call function FSCRT_Array_Init to initialize it and FSCRT_Array_Clear to release it.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page or pageObjList is NULL, or pageObjList::dataType is not FSCRT_VT_OBJECT_PAGEOBJECT, or typeFilter is invalid, or tolerance is negative value.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_NOTFOUND if no page object is at the specified position.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObjList::data: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObjects_InsertObject ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECTS  pageObjs,
FS_INT32  typeFilter,
FS_INT32  index,
FSPDF_PAGEOBJECT  pageObj 
)

Insert a page object and it will be automatically freed.

If parameter typeFilter is FSPDF_PAGEOBJECT_ALL, parameter index is for all page objects.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjsHandle to a FSPDF_PAGEOBJECTS object which is the page objects. It should be valid.
[in]typeFilterA filter flag for the type of page objects. Please refer to macro definitions FSPDF_PAGEOBJECT_XXX and this should be one of these macros.
[in]indexIndex of page object. Range: 0 to (objcount-1). objcount is returned by function FSPDF_PageObjects_CountObjects.
If index is larger than (objcount-1), pageObj will be inserted to be the last one. if index is smaller than 0, pageObj will be inserted to be the first one.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is a page object. It should be valid.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObjs or pageObj is a NULL pointer, or typeFilter is invalid.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or inserting page object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_CONFLICT if parameter pageObj has existed in parameter pageObjs.
FSCRT_ERRCODE_ERROR if fail to insert page object for any other reason.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Parameter pageObj can be returned by function FSPDF_TextObject_Create, FSPDF_PathObject_Create, FSPDF_ImageObject_Create, FSPDF_FormXObject_Create, or FSPDF_PageObject_Clone.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObjs: this handle is short-term.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PageObjects_RemoveObject ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECTS  pageObjs,
FSPDF_PAGEOBJECT  pageObj 
)

Remove a page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pageObjsHandle to a FSPDF_PAGEOBJECTS object which is the page objects. It should be valid.
[in]pageObjHandle to a FSPDF_PAGEOBJECT object which is one page object. It should be valid.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pageObjs or pageObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or removing page object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_NOTFOUND if specific page object is not found in current page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pageObjs: this handle is short-term.
  • pageObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PathObject_ConvertFromTextObject ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT *  convertedObj 
)

Convert text object to path object for avoiding print deviation.

Note
After call this function, caller might need to call function FSPDF_PageObjects_GenerateContents to generate its contents, Or the change of page object could not be saved to document.
Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in,out]convertedObjPointer to a FSPDF_PAGEOBJECT object. It should be valid. When this function is called, it is a text object.
When this function returns, it receives the path object.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page or convertedObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or converting text object to path object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter convertedObj is not a text object.
FSCRT_ERRCODE_ERROR if fail to convert text object to path object for any other reason.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or if the memory access is wrong.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • textObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PathObject_Create ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT *  pathObj 
)

Create a new path object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[out]pathObjPointer to a FSPDF_PAGEOBJECT object that receives the newly created path object. If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pathObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or creating path object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page. FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pathObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PathObject_GetFillMode ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pathObj,
FS_INT32 fillMode 
)

Get fill mode of a path object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pathObjHandle to a FSPDF_PAGEOBJECT object which is a path object. It should be valid.
[out]fillModePointer to a FS_INT32 object that receives the fill mode. Please refer to macro definitions FSCRT_FILLMODE_XXX and this would be one of these macros.
If there is any error, it will be set FSCRT_FILLMODE_NONE.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pathObj or fillMode is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, pathObj is not a path object.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pathObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PathObject_GetPathData ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pathObj,
FSCRT_PATHDATA *  pathData 
)

Get of path data of a path object .

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pathObjHandle to a FSPDF_PAGEOBJECT object which is a path object. It should be valid.
[out]pathDataHandle to a FSCRT_PATHDATA handle that receives path data.
When this is not used any more, application should release this handle by calling function FSCRT_PathData_Release.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pathObj or pathData is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter pathObj is not a path object.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pathObj: this handle is short-term.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PathObject_GetStrokeState ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pathObj,
FS_BOOL isStroke 
)

Get stroke state of a path object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pathObjHandle to a FSPDF_PAGEOBJECT object which is a path object. It should be valid.
[out]isStrokePointer to a FS_BOOL object that receives a boolean value to indicate stroke state of path object:
  • TRUE: the path object is stroked.
  • FALSE: the path object is not stroked.
If there is any error, it will be set FALSE.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pathObj or isStroke is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter pathObj is not a path object.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pathObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PathObject_SetFillMode ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pathObj,
FS_INT32  fillMode 
)

Set fill mode of a path object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pathObjHandle to a FSPDF_PAGEOBJECT object which is a path object. It should be valid.
[in]fillModePlease refer to macro definitions FSCRT_FILLMODE_XXX and this should be one of these macros.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pathObj is a NULL pointer, or fillMode is invalid.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting path object fill mode is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter pathObj is not a path object.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pathObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PathObject_SetPathData ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pathObj,
FSCRT_PATHDATA  pathData 
)

Set path data of a path object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pathObjHandle to a FSPDF_PAGEOBJECT object which is a path object. It should be valid.
[in]pathDataHandle to a FSCRT_PATHDATA object to be set.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, pathObj or pathData is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting path object path data is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter pathObj is not a path object.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pathObj: this handle is short-term.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_PathObject_SetStrokeState ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  pathObj,
FS_BOOL  isStroke 
)

Set stroke state of a path object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]pathObjHandle to a FSPDF_PAGEOBJECT object which is a path object. It should be valid.
[in]isStrokeA FS_BOOL value that specifies the stroke state:
  • TRUE: the path object of parameter pathObj to be stroked.
  • FALSE the path object of parameter pathObj not to be stroked
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page or pathObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting path object stroke state is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter pathObj is not a path object.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • pathObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_ShadingObject_GetShading ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  shadingObj,
FSPDF_OBJECT *  shadingPDFObj 
)

Get the PDF shading dictionary or stream object of a shading page object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]shadingObjHandle to a FSPDF_PAGEOBJECT object which is a shading object. It should be valid.
[out]shadingPDFObjPointer to a FSPDF_OBJECT handle that receives the shading PDF object, it would be a dictionary or stream object.
If there is any error, it will be set NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, shadingObj or shadingPDFObj is a NULL pointer.
FSCRT_ERRCODE_NOTFOUND if there is no shading PDF object found. FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter shadingObj is not a shading object.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • shadingObj: this handle is short-term.
  • shadingPDFObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_TextObject_Create ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT *  textObj 
)

Create a new text Object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[out]textObjPointer to a FSPDF_PAGEOBJECT handle that receives the newly created text object. If there is any error, it will be NULL.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page or textObj is a NULL pointer.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or creating text object is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • textObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_TextObject_GetTextState ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  textObj,
FSPDF_TEXTSTATE textState 
)

Get text states of a text object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]textObjHandle to a FSPDF_PAGEOBJECT object which is a text object. It should be valid.
[out]textStatePointer to a FSPDF_TEXTSTATE structure that receives text state.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter textObj, page or textState is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter textObj is not a text object.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or if the memory access is wrong.
FSCRT_ERRCODE_ERROR if fail to get text states of a text object for any other reason.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • textObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_TextObject_GetUnicodeString ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  textObj,
FSCRT_BSTR unicodeStr 
)

Get unicode string of a text object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]textObjHandle to a FSPDF_PAGEOBJECT object which is a text object. It should be valid.
[out]unicodeStrPointer to a FSCRT_BSTR structure that receives the unicode string, and it should not be NULL. The result will be in UTF-8.
If there is any error, FSCRT_BSTR::str will be set empty if it is not NULL, and FSCRT_BSTR::len will be set 0.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, textObj or unicodeStr is a NULL pointer.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter textObj is not a text object.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or if the memory access is wrong.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
If paramter unicodeStr is empty or has not enough memory, this function will allocate memory by calling function FSCRT_BStr_SetLength.
If it allocates memory by function FSCRT_BStr_SetLength, caller must call function FSCRT_BStr_Clear to free memory.
It is better that caller prepares enough space before calling this function if possible.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • textObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_TextObject_SetTextState ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  textObj,
const FSPDF_TEXTSTATE textState,
FS_BOOL  italic,
FS_INT32  weight 
)

Set text states of a text object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]textObjHandle to a FSPDF_PAGEOBJECT object which is a text object. It should be valid.
[in]textStatePointer to a FSPDF_TEXTSTATE structure to be set.
[in]italicA boolean value which indicates whether the set text is italic or not.
[in]weightOriginal font weight, if larger than 500 it indicates bold.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, textObj or textState is a NULL pointer, or some members of textState are invalid.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting text object text state is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter textObj is not a text object.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or if the memory access is wrong.
FSCRT_ERRCODE_ERROR if fail to set text state of a text object for any other reason.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • textObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSPDF_TextObject_SetUnicodeString ( FSCRT_PAGE  page,
FSPDF_PAGEOBJECT  textObj,
const FSCRT_BSTR unicodeStr 
)

Set unicode string for a text object.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a PDF page. It should be valid.
[in]textObjHandle to a FSPDF_PAGEOBJECT object which is a text object. It should be valid.
[in]unicodeStrPointer to a FSCRT_BSTR structure to be set. It should be in UTF-8 format.
Returns
FSCRT_ERRCODE_SUCCESS if successful.
FSCRT_ERRCODE_PARAM if parameter page, textObj or unicodeStr is a NULL pointer, or textObj is not set the font.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or setting text object string is not allowed.
FSCRT_ERRCODE_INVALIDTYPE if parameter page is not a PDF page, or parameter textObj is not a text object.
FSCRT_ERRCODE_FORMAT if parameter unicodeStr is not in UTF-8 format.
FSCRT_ERRCODE_ERROR if fail to set unicode string for a text object for any other reason.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or if the memory access is wrong.
FSCRT_ERRCODE_UNRECOVERABLE if the function finds an unrecoverable error internally.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
User must call FSPDF_TextObject_SetTextState to set a font for textObj if return FSCRT_ERRCODE_PARAM because font is not to be set.
Attention
Thread Safety: this function is not thread safe. Do not call it for the same objects under multi-threaded environment; otherwise, the application should be synchronized.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is short-term.
  • page: this handle is long-term partially recoverable.
  • textObj: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.

Foxit Corporation