Base

Base data structure and operation definitions for Foxit PDF SDK.
Definitions and functions in this module are included in fs_base_r.h and fs_codec_r.h.
Module: Base
License Identifier: Base/All
Available License Right: unnecessary. More...

Classes

struct  FSCRT_VAR
 Structure for variant definitions. More...
 
struct  FSCRT_BSTR
 Structure for byte string. More...
 
struct  FSCRT_ARRAY
 Structure for array. More...
 
struct  FSCRT_FILE
 Handle type of file objects. More...
 
struct  FSCRT_FILESIZE
 Structure for large file size. More...
 
struct  FSCRT_FILEHANDLER
 Structure for file reading or writing (I/O). More...
 
struct  FSCRT_FILEHANDLER_L
 Structure for file with large size for reading or writing (I/O). More...
 
struct  FSCRT_MEMMGRHANDLER
 Structure for memory management. More...
 
struct  FSCRT_THREAD
 Handle type to thread object. More...
 
struct  FSCRT_THREADHANDLER
 Structure for multiple-thread support. More...
 
struct  FSCRT_DATETIMEZONE
 Structure for date and time. More...
 
struct  FSCRT_RECT
 Structure for rectangle, in integer. More...
 
struct  FSCRT_RECTF
 Structure for rectangle, in float. More...
 
struct  FSCRT_QUADPOINTSF
 Structure for quad points, in float. More...
 
struct  FSCRT_MATRIX
 Structure for 2D matrix. More...
 
struct  FSCRT_PATHDATA
 Handle type to a path data. More...
 
struct  FSCRT_DOCUMENT
 Handle type to a document. More...
 
struct  FSCRT_PAGE
 Handle type to a page. More...
 
struct  FSCRT_ANNOT
 Handle type to an annot. More...
 
struct  FSCRT_PROGRESS
 Handle type to a progress. More...
 
struct  FSCRT_PAUSEHANDLER
 Structure for pause control in progressive process. More...
 
struct  FSCRT_FONT
 Handle type to a font. More...
 
struct  FSCRT_FONTMAPPERHANDLER
 Structure for font mapping. More...
 
struct  FSCRT_FONTFACE
 Structure to get properties of a font face. More...
 
struct  FSCRT_ARCHIVE
 Handle type to an archive. More...
 
struct  FSCRT_POSITION
 Handle type to position. More...
 
struct  FSCRT_DIGEST
 Handle type to a DIGEST. More...
 

Macros

#define FSCRT_Var_SetInt8Value(variant, value)   (variant).type = FSCRT_VT_INT8, (variant).var.int8Var = (value);
 Macro to set FS_INT8 value for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetUInt8Value(variant, value)   (variant).type = FSCRT_VT_UINT8, (variant).var.uint8Var = (value);
 Macro to set FS_UINT8 value for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetInt16Value(variant, value)   (variant).type = FSCRT_VT_INT16, (variant).var.int16Var = (value);
 Macro to set FS_INT16 value for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetUInt16Value(variant, value)   (variant).type = FSCRT_VT_UINT16, (variant).var.uint16Var = (value);
 Macro to set FS_UINT16 value for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetInt32Value(variant, value)   (variant).type = FSCRT_VT_INT32, (variant).var.int32Var = (value);
 Macro to set FS_INT32 value for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetUInt32Value(variant, value)   (variant).type = FSCRT_VT_UINT32, (variant).var.uint32Var = (value);
 Macro to set FS_UINT32 value for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetBooleanValue(variant, value)   (variant).type = FSCRT_VT_BOOL, (variant).var.boolVar = (value);
 Macro to set FS_BOOL value for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetFloatValue(variant, value)   (variant).type = FSCRT_VT_FLOAT, (variant).var.floatVar = (value);
 Macro to set FS_FLOAT value for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetVoidPtrValue(variant, value)   (variant).type = FSCRT_VT_LPVOID, (variant).var.voidPtrVar = (value);
 Macro to set FS_LPVOID value for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetInt8PtrValue(variant, value)   (variant).type = FSCRT_VT_LPINT8, (variant).var.int8PtrVar = (value);
 Macro to set FS_INT8 pointer for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetUInt8PtrValue(variant, value)   (variant).type = FSCRT_VT_LPUINT8, (variant).var.uint8PtrVar = (value);
 Macro to set FS_UINT8 pointer for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetInt16PtrValue(variant, value)   (variant).type = FSCRT_VT_LPINT16, (variant).var.int16PtrVar = (value);
 Macro to set FS_INT16 pointer for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetUInt16PtrValue(variant, value)   (variant).type = FSCRT_VT_LPUINT16, (variant).var.uint16PtrVar = (value);
 Macro to set FS_UINT16 pointer for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetInt32PtrValue(variant, value)   (variant).type = FSCRT_VT_LPINT32, (variant).var.int32PtrVar = (value);
 Macro to set FS_INT32 pointer for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetUInt32PtrValue(variant, value)   (variant).type = FSCRT_VT_LPUINT32, (variant).var.uint32PtrVar = (value);
 Macro to set FS_UINT32 pointer for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetBooleanPtrValue(variant, value)   (variant).type = FSCRT_VT_LPBOOL, (variant).var.boolPtrVar = (value);
 Macro to set FS_BOOL pointer for a FSCRT_VAR structure. More...
 
#define FSCRT_Var_SetFloatPtrValue(variant, value)   (variant).type = FSCRT_VT_LPFLOAT, (variant).var.floatPtrVar = (value);
 Macro to set FS_FLOAT pointer for a FSCRT_VAR structure. More...
 
#define FSCRT_BSTRD(str)   {str, sizeof(str) - 1}
 Macro to construct a byte string with constant string value.The encoding of string should be UTF-8 compatible. More...
 
#define FSCRT_BSTRC(v, str)   FSCRT_BSTR v = FSCRT_BSTRD(str)
 Macro to construct a byte string with constant string value.The encoding of string should be UTF-8 compatible. More...
 
#define FSCRT_BStr_InitConstString(v, s)   (v).str = s, (v).len = sizeof(s) - 1;
 Macro to initialize constant string value.The encoding of string should be UTF-8 compatible. More...
 
#define FSCRT_BStr_SetConstString(bstr, str)   FSCRT_BStr_Set(bstr, str, sizeof(str) - 1)
 Macro to set constant string value. More...
 
#define FSCRT_BStr_Copy(dstStr, srcStr)   FSCRT_BStr_Set(dstStr, (srcStr)->str, (srcStr)->len)
 Macro to copy string value. More...
 

Typedefs

typedef void(* FSCRT_CALLBACK_THREADFINALIZE) (FSCRT_THREAD thread)
 A callback function definition for finalizing a thread. More...
 
typedef void(* FSCRT_CALLBACK_FREEPRIVATEDATA) (FS_LPVOID data)
 A callback function to free private data. More...
 

Functions

FS_RESULT FSCRT_BStr_Init (FSCRT_BSTR *bstr)
 Helper function to initialize a byte string. More...
 
FS_RESULT FSCRT_BStr_Clear (FSCRT_BSTR *bstr)
 Helper function to clear a byte string. More...
 
FS_RESULT FSCRT_BStr_SetLength (FSCRT_BSTR *bstr, FS_DWORD length)
 Helper function to set length of a byte string. More...
 
FS_RESULT FSCRT_BStr_Set (FSCRT_BSTR *bstr, FS_LPCSTR str, FS_DWORD length)
 Helper function to set string data. More...
 
FS_RESULT FSCRT_Array_Init (FSCRT_ARRAY *array, FS_INT32 dataType)
 Helper function to initialize array. More...
 
FS_RESULT FSCRT_Array_Clear (FSCRT_ARRAY *array)
 Helper function to release the array. More...
 
FS_RESULT FSCRT_File_Create (FSCRT_FILEHANDLER *fileStream, FSCRT_FILE *file)
 Create a file object from file stream. More...
 
FS_RESULT FSCRT_File_Create_L (FSCRT_FILEHANDLER_L *fileStream, FSCRT_FILE *file)
 Create a FSCRT_FILE object from a large file, which the file size could be over 2GB. More...
 
FS_RESULT FSCRT_File_CreateCacheFile (FSCRT_FILEHANDLER *fileStream, FS_DWORD chunkSize, FS_DWORD chunkCount, FS_LPVOID buffer, FSCRT_FILE *file)
 Create a cached file object from file stream. More...
 
FS_RESULT FSCRT_File_CreateFromMemory (FS_LPVOID buffer, FS_DWORD length, FSCRT_FILE *file)
 Create a memory-based file object. More...
 
FS_RESULT FSCRT_File_CreateFromFileName (const FSCRT_BSTR *fileName, FS_DWORD fileModes, FSCRT_FILE *file)
 Create a file object from a specific file path. More...
 
FS_RESULT FSCRT_File_GetSize (FSCRT_FILE file, FSCRT_FILESIZE *fileSize)
 Get the number of bytes of a file object. More...
 
FS_RESULT FSCRT_File_SetRange (FSCRT_FILE file, const FSCRT_FILESIZE *offset, const FSCRT_FILESIZE *length)
 Set reading range of file object, the following reading from file would be restricted in this range. More...
 
FS_RESULT FSCRT_File_ClearRange (FSCRT_FILE file)
 Clear the reading range of file object, the current reading position will not be affected. More...
 
FS_RESULT FSCRT_File_Read (FSCRT_FILE file, FS_LPVOID buffer, const FSCRT_FILESIZE *size, FSCRT_FILESIZE *actualSize)
 Read data from file object. More...
 
FS_RESULT FSCRT_File_Write (FSCRT_FILE file, FS_LPVOID buffer, const FSCRT_FILESIZE *size)
 Write data to file object. More...
 
FS_RESULT FSCRT_File_Release (FSCRT_FILE file)
 Release a file object. More...
 
FS_RESULT FSCRT_Library_CreateMgr (FS_LPVOID memory, FS_DWORD size, FSCRT_MEMMGRHANDLER *memMgr)
 Create a Foxit PDF SDK manager. More...
 
FS_RESULT FSCRT_Library_CreateDefaultMgr ()
 Create a default Foxit PDF SDK manager by applications. More...
 
FS_RESULT FSCRT_Library_GetMgr (FS_LPVOID *sdkMgr)
 Get the current Foxit PDF SDK manager. More...
 
FS_RESULT FSCRT_Library_SetMgr (FS_LPVOID sdkMgr)
 Set the current Foxit PDF SDK manager. More...
 
void FSCRT_Library_DestroyMgr ()
 Destroy the current Foxit PDF SDK manager. More...
 
FS_RESULT FSCRT_Library_GetFixedMemSize (FS_DWORD *memSize)
 Get the used memory size of the fixed memory manager in Foxit PDF SDK. Only available when a library manager is created by the function FSCRT_Library_CreateMgr. More...
 
FS_RESULT FSCRT_License_UnlockLibrary (const FSCRT_BSTR *licenseKey, const FSCRT_BSTR *unlockCode)
 Unlock Foxit PDF SDK library using a license key and a code. More...
 
FS_RESULT FSCRT_License_GetType (FS_INT32 *type)
 Get the current license type. More...
 
FS_RESULT FSCRT_Library_SetLogFile (FSCRT_FILE file)
 Set a log file handle. Currently only support Windows 32-bit, and not support Windows 8. More...
 
FS_RESULT FSCRT_Library_EnableJavaScript (FS_BOOL isEnabled)
 Enable or disable javascript for PDF. More...
 
FS_RESULT FSCRT_Memory_Alloc (FS_DWORD size, FS_LPVOID *ptr)
 Allocate a memory block. More...
 
FS_RESULT FSCRT_Memory_Realloc (FS_LPVOID ptr, FS_DWORD newSize, FS_LPVOID *newPtr)
 Reallocate a memory block. More...
 
void FSCRT_Memory_Free (FS_LPVOID ptr)
 Free a memory block. More...
 
FS_RESULT FSCRT_Library_GetVersion (FSCRT_BSTR *sdkVersion)
 Get the current Foxit PDF SDK version. More...
 
FS_RESULT FSCRT_Library_SetThreadHandler (FSCRT_THREADHANDLER *threadHandler)
 Set a thread handler into Foxit PDF SDK library. More...
 
FS_RESULT FSCRT_Library_SetCacheSize (FS_DWORD size)
 Set the upper limit of PDF library cache size. More...
 
FS_RESULT FSCRT_Rect_IsAdjacent (const FSCRT_RECTF *rect1, const FSCRT_RECTF *rect2, FS_FLOAT alignmentTolerance, FS_FLOAT distanceTolerance, FS_DWORD direction, FS_BOOL *adjacent)
 Helper function to determine whether one rectangle is adjacent to another in the horizontal or vertical direction. More...
 
FS_RESULT FSCRT_Matrix_Translate (FSCRT_MATRIX *matrix, FS_FLOAT offsetX, FS_FLOAT offsetY)
 Translate a coordinate matrix. More...
 
FS_RESULT FSCRT_Matrix_Scale (FSCRT_MATRIX *matrix, FS_FLOAT scaleX, FS_FLOAT scaleY)
 Scale a coordinate matrix. More...
 
FS_RESULT FSCRT_Matrix_Rotate (FSCRT_MATRIX *matrix, FS_FLOAT angle)
 Rotate a coordinate matrix. More...
 
FS_RESULT FSCRT_Matrix_Shear (FSCRT_MATRIX *matrix, FS_FLOAT alpha, FS_FLOAT beta)
 Make a shear transformation on a coordinate matrix. More...
 
FS_RESULT FSCRT_Matrix_GetReverse (const FSCRT_MATRIX *srcMatrix, FSCRT_MATRIX *dstMatrix)
 Get a reversed matrix. More...
 
FS_RESULT FSCRT_Matrix_Concat (FSCRT_MATRIX *dstMatrix, const FSCRT_MATRIX *srcMatrix)
 Concatenate another matrix. More...
 
FS_RESULT FSCRT_Matrix_TransformPoint (const FSCRT_MATRIX *matrix, FS_INT32 *x, FS_INT32 *y)
 Transform an integer point by a matrix. More...
 
FS_RESULT FSCRT_Matrix_TransformPointF (const FSCRT_MATRIX *matrix, FS_FLOAT *x, FS_FLOAT *y)
 Transform a float point by a matrix. More...
 
FS_RESULT FSCRT_Matrix_TransformRect (const FSCRT_MATRIX *matrix, FSCRT_RECT *rect)
 Transform an integer rectangle by a matrix. More...
 
FS_RESULT FSCRT_Matrix_TransformRectF (const FSCRT_MATRIX *matrix, FSCRT_RECTF *rect)
 Transform a float rectangle by a matrix. More...
 
FS_RESULT FSCRT_PathData_Create (FSCRT_PATHDATA *pathData)
 Create new path data. More...
 
FS_RESULT FSCRT_PathData_Clear (FSCRT_PATHDATA pathData)
 Clear all points of the given path data. More...
 
FS_RESULT FSCRT_PathData_Release (FSCRT_PATHDATA pathData)
 Release all related resources of the given path data. More...
 
FS_RESULT FSCRT_PathData_CountPoints (FSCRT_PATHDATA pathData, FS_INT32 *count)
 Get number of points of the given path data. More...
 
FS_RESULT FSCRT_PathData_AddPointsCount (FSCRT_PATHDATA pathData, FS_INT32 count)
 Add a number of points to the given path data. More...
 
FS_RESULT FSCRT_PathData_GetPoint (FSCRT_PATHDATA pathData, FS_INT32 index, FS_FLOAT *x, FS_FLOAT *y, FS_INT32 *pointType)
 Get a specific point of the given path data. More...
 
FS_RESULT FSCRT_PathData_SetPoint (FSCRT_PATHDATA pathData, FS_INT32 index, FS_FLOAT x, FS_FLOAT y, FS_INT32 pointType)
 Set the specific point of the path data. More...
 
FS_RESULT FSCRT_PathData_RemovePoint (FSCRT_PATHDATA pathData, FS_INT32 index)
 Remove the specific point of the given path data. More...
 
FS_RESULT FSCRT_PathData_MoveTo (FSCRT_PATHDATA pathData, FS_FLOAT x, FS_FLOAT y)
 Add a point to start a figure. This point will become a new current position. More...
 
FS_RESULT FSCRT_PathData_LineTo (FSCRT_PATHDATA pathData, FS_FLOAT x, FS_FLOAT y)
 Add a point to a given figure, and a line is to be drawn from the current position to this point, which then becomes a new current position. More...
 
FS_RESULT FSCRT_PathData_CubicBezierTo (FSCRT_PATHDATA pathData, FS_FLOAT x1, FS_FLOAT y1, FS_FLOAT x2, FS_FLOAT y2, FS_FLOAT x3, FS_FLOAT y3)
 Add Bezier points to a given path data. More...
 
FS_RESULT FSCRT_PathData_AppendRect (FSCRT_PATHDATA pathData, const FSCRT_RECTF *rect)
 Add a rectangle figure to path data. More...
 
FS_RESULT FSCRT_PathData_AppendEllipse (FSCRT_PATHDATA pathData, const FSCRT_RECTF *rect)
 Add an ellipse figure to path data. More...
 
FS_RESULT FSCRT_PathData_CloseFigure (FSCRT_PATHDATA pathData)
 Close the last figure of path data. More...
 
FS_RESULT FSCRT_PathData_Transform (FSCRT_PATHDATA pathData, const FSCRT_MATRIX *matrix)
 Transform all path points into path data with a given matrix. More...
 
FS_RESULT FSCRT_Library_SetPrivateData (FS_LPVOID moduleID, FS_LPVOID data, FSCRT_CALLBACK_FREEPRIVATEDATA callbackFreePrivateData)
 Set private data. More...
 
FS_RESULT FSCRT_Library_GetPrivateData (FS_LPVOID moduleID, FS_LPVOID *data)
 Get private data. More...
 
FS_RESULT FSCRT_Library_RemovePrivateData (FS_LPVOID moduleID)
 Remove private data. More...
 
FS_RESULT FSCRT_Doc_GetType (FSCRT_DOCUMENT document, FS_INT32 *docType)
 Get a document type. More...
 
FS_RESULT FSCRT_Page_GetDocument (FSCRT_PAGE page, FSCRT_DOCUMENT *document)
 Get a document handle related to a page. More...
 
FS_RESULT FSCRT_Annot_GetPage (FSCRT_ANNOT annot, FSCRT_PAGE *page)
 Get a page handle related to an annotation. Only support PDF annotation. More...
 
FS_RESULT FSCRT_Progress_Continue (FSCRT_PROGRESS progress, FSCRT_PAUSEHANDLER *pause)
 Continue a progressive process. More...
 
FS_RESULT FSCRT_Progress_GetPercent (FSCRT_PROGRESS progress, FS_INT32 *percent)
 Get a percent of progressive process. More...
 
FS_RESULT FSCRT_Progress_Release (FSCRT_PROGRESS progress)
 Release the current progressive process. More...
 
FS_RESULT FSCRT_Progress_SetProperty (FSCRT_PROGRESS progress, const FSCRT_BSTR *property, const FSCRT_VAR *values, FS_INT32 count)
 Set property of current progressive process. More...
 
FS_RESULT FSCRT_Library_SetFontMapperHandler (FSCRT_FONTMAPPERHANDLER *fontMapperHandler)
 Use a system font mapper (typically for Chinese/Japanese/Korean charsets). More...
 
FS_RESULT FSCRT_Library_AddFontFile (FSCRT_FILE fontFile)
 Add an additional font (typically a TrueType, Type1 or CFF font) to Foxit PDF SDK library from FSCRT_FILE. More...
 
FS_RESULT FSCRT_Library_LoadSystemFonts ()
 Load the installed local system fonts for Foxit PDF SDK. More...
 
FS_RESULT FSCRT_Font_Create (const FSCRT_BSTR *fontName, FS_DWORD fontStyles, FS_INT32 weight, FS_INT32 charset, FSCRT_FONT *font)
 Create a font with the given attributes. More...
 
FS_RESULT FSCRT_Font_CreateStandard (FS_INT32 fontID, FSCRT_FONT *font)
 Create a standard font by a font ID. More...
 
FS_RESULT FSCRT_Font_EnumFaces (FSCRT_FILE fontFile, FSCRT_FONTFACE *faces, FS_INT32 *count)
 Enum faces from a font file. More...
 
FS_RESULT FSCRT_Font_CreateFromFile (FSCRT_FILE fontFile, FS_INT32 faceIndex, FS_INT32 charset, FSCRT_FONT *font)
 Create a font from a font file. More...
 
FS_RESULT FSCRT_Font_Release (FSCRT_FONT font)
 Release a font object. More...
 
FS_RESULT FSCRT_Font_GetName (FSCRT_FONT font, FSCRT_BSTR *fontName)
 Retrieve a face name of a font and return a name in string. More...
 
FS_RESULT FSCRT_Font_IsBold (FSCRT_FONT font, FS_BOOL *bold)
 Judge whether a font object is bold or not. More...
 
FS_RESULT FSCRT_Font_IsItalic (FSCRT_FONT font, FS_BOOL *italic)
 Judge whether a font object is italic or not. More...
 
FS_RESULT FSCRT_Font_GetAscent (FSCRT_FONT font, FS_INT32 *ascent)
 Get an ascent value of a font. More...
 
FS_RESULT FSCRT_Font_GetDescent (FSCRT_FONT font, FS_INT32 *descent)
 Get a descent value of a font. More...
 
FS_RESULT FSCRT_Font_GetCharBBox (FSCRT_FONT font, FS_DWORD unicode, FSCRT_RECT *bbox)
 Get a specific character bounding box of a font. More...
 
FS_RESULT FSCRT_Font_GetCharWidth (FSCRT_FONT font, FS_DWORD unicode, FS_FLOAT *width)
 Get a specific character width of a font. More...
 
FS_RESULT FSCRT_Archive_Create (FSCRT_ARCHIVE *archive)
 Create an archive object for serializing and de-serializing. More...
 
FS_RESULT FSCRT_Archive_Release (FSCRT_ARCHIVE archive)
 Release an archive handle. More...
 
FS_RESULT FSCRT_Archive_GetData (FSCRT_ARCHIVE archive, FSCRT_BSTR *data)
 Get data from an archive object. More...
 
FS_RESULT FSCRT_Archive_LoadData (FSCRT_ARCHIVE archive, const FSCRT_BSTR *data)
 Load data to an archive object. More...
 
FS_RESULT FSCRT_UTF8_CountChars (const FSCRT_BSTR *utf8Str, FS_DWORD *count, FS_DWORD *pos)
 Get count of characters stored in a UTF-8 string. More...
 
FS_RESULT FSCRT_UTF8_ToUTF16LE (const FSCRT_BSTR *utf8Str, FS_WORD *buffer, FS_DWORD *length)
 Convert a UTF-8 string to a UTF-16LE string. More...
 
FS_RESULT FSCRT_UTF8_ToUTF16BE (const FSCRT_BSTR *utf8Str, FS_WORD *buffer, FS_DWORD *length)
 Convert a UTF-8 string to a UTF-16BE string. More...
 
FS_RESULT FSCRT_UTF8_ToUTF32LE (const FSCRT_BSTR *utf8Str, FS_DWORD *buffer, FS_DWORD *length)
 Convert a UTF-8 string to a UTF-32LE string. More...
 
FS_RESULT FSCRT_UTF8_ToUTF32BE (const FSCRT_BSTR *utf8Str, FS_DWORD *buffer, FS_DWORD *length)
 Convert a UTF-8 string to a UTF-32BE string. More...
 
FS_RESULT FSCRT_UTF8_FromUTF16LE (FSCRT_BSTR *utf8Str, const FS_WORD *buffer, FS_DWORD length)
 Encode a UTF-16LE string into a UTF-8 string. More...
 
FS_RESULT FSCRT_UTF8_FromUTF16BE (FSCRT_BSTR *utf8Str, const FS_WORD *buffer, FS_DWORD length)
 Convert a UTF-16BE string into a UTF-8 string. More...
 
FS_RESULT FSCRT_UTF8_FromUTF32LE (FSCRT_BSTR *utf8Str, const FS_DWORD *buffer, FS_DWORD length)
 Convert a UTF-32LE string into a UTF-8 string. More...
 
FS_RESULT FSCRT_UTF8_FromUTF32BE (FSCRT_BSTR *utf8Str, const FS_DWORD *buffer, FS_DWORD length)
 Convert a UTF-32BE string into a UTF-8 string. More...
 
FS_RESULT FSCRT_Base64_DecodeToBuffer (const FSCRT_BSTR *base64Str, FS_LPVOID buffer, FS_DWORD *length, FS_DWORD *pos)
 Convert a BASE-64 string into a buffer. More...
 
FS_RESULT FSCRT_Base64_EncodeFromBuffer (FSCRT_BSTR *base64Str, FS_LPCVOID buffer, FS_DWORD length)
 Encode a buffer into a BASE-64 string. More...
 
FS_RESULT FSCRT_Digest_Start (FS_INT32 digestType, FSCRT_DIGEST *digest)
 Setup a DIGEST context. More...
 
FS_RESULT FSCRT_Digest_Update (FSCRT_DIGEST digest, FS_LPVOID buf, FS_DWORD size)
 Update the DIGEST with some new data. Function FSCRT_Digest_Start must be called before. More...
 
FS_RESULT FSCRT_Digest_Finish (FSCRT_DIGEST digest, FSCRT_BSTR *hash)
 Finish the process and output the digest. More...
 
FS_RESULT FSCRT_Flate_Compress (const FSCRT_BSTR *src, FSCRT_BSTR *dst)
 Compress data by using the flate algorithm. More...
 
FS_RESULT FSCRT_Flate_Decompress (const FSCRT_BSTR *src, FSCRT_BSTR *dst)
 Decompress data by using the flate algorithm. More...
 

Basic Types Definitions

Note
In order to support cross platforms, PDF SDK defines basic types for applications or other modules to use. It is highly recommended for applications to use these types rather than other types. Applications need to convert C/C++ standard types to PDF SDK supporting types.
typedef void * FS_LPVOID
 A pointer to any types.
 
typedef void const * FS_LPCVOID
 A constant pointer to any types.
 
typedef int FS_BOOL
 Boolean type (This should be TRUE or FALSE).
 
typedef unsigned char FS_BYTE
 An unsigned byte integer (8 bits).
 
typedef unsigned short FS_WORD
 16-bit unsigned integer.
 
typedef unsigned int FS_DWORD
 32-bit unsigned integer.
 
typedef unsigned int FS_ARGB
 ARGB color type, 32 bits, ((b) | ((g) << 8) | ((r) << 16)) | ((a) << 24)
 
typedef float FS_FLOAT
 32-bit floating-point number, single precision.
 
typedef char FS_CHAR
 8-bit character.
 
typedef char * FS_LPSTR
 A pointer to string.
 
typedef char const * FS_LPCSTR
 A constant pointer to string.
 
typedef int FS_RESULT
 Result code for functions in Foxit PDF SDK.
 
typedef char FS_INT8
 8-bit signed integer.
 
typedef unsigned char FS_UINT8
 8-bit unsigned integer.
 
typedef short FS_INT16
 16-bit signed integer.
 
typedef unsigned short FS_UINT16
 16-bit unsigned integer.
 
typedef int FS_INT32
 32-bit signed integer.
 
typedef unsigned int FS_UINT32
 32-bit unsigned integer.
 

Macro Definitions for Error Codes

Note
In PDF SDK, error codes are returned to callers as FS_RESULT type.
0 indicates normal success status, positive value indicates current running status, and negative value indicates a failure.
#define FSCRT_ERRCODE_SUCCESS   0
 Success.
 
#define FSCRT_ERRCODE_ERROR   -1
 Common error for any kind.
 
#define FSCRT_ERRCODE_INVALIDMANAGER   -2
 Invalid Foxit PDF SDK manager.
 
#define FSCRT_ERRCODE_INVALIDMODULE   -3
 Invalid module or module uninitialized.
 
#define FSCRT_ERRCODE_UNRECOVERABLE   -4
 The function cannot be recovered.
 
#define FSCRT_ERRCODE_OUTOFMEMORY   -5
 Memory out of memory.
 
#define FSCRT_ERRCODE_PASSWORD   -6
 Incorrect password.
 
#define FSCRT_ERRCODE_FORMAT   -7
 Data format error.
 
#define FSCRT_ERRCODE_FILE   -8
 File access error, cannot read or write file data.
 
#define FSCRT_ERRCODE_PARAM   -9
 Parameter error.
 
#define FSCRT_ERRCODE_INVALIDLICENSE   -10
 License authorization error.
 
#define FSCRT_ERRCODE_HANDLER   -11
 Callback functions in handler are error.
 
#define FSCRT_ERRCODE_UNKNOWNSECURITYHANDLER   -12
 Unknown security handler or cannot find availably one.
 
#define FSCRT_ERRCODE_INVALIDCERTIFICATE   -13
 Incorrect certificate or its data error.
 
#define FSCRT_ERRCODE_NOTFOUND   -14
 Data cannot be found.
 
#define FSCRT_ERRCODE_INVALIDTYPE   -15
 Invalid object type.
 
#define FSCRT_ERRCODE_UNSUPPORTED   -16
 Some features are not implemented, cannot be used, usually for user-side callback functions.
 
#define FSCRT_ERRCODE_NOTPARSED   -17
 Contents are not parsed.
 
#define FSCRT_ERRCODE_UNKNOWNSTATE   -18
 State is error or unknown.
 
#define FSCRT_ERRCODE_BUFFEROVERFLOW   -19
 Buffer is overflow, need more space.
 
#define FSCRT_ERRCODE_CONFLICT   -20
 Data or values conflict.
 
#define FSCRT_ERRCODE_DATANOTREADY   -21
 Data not ready.
 
#define FSCRT_ERRCODE_MEMORYREBUILT   -22
 Memory is rebuilt.
 
#define FSCRT_ERRCODE_UNKNOWNHANDLER   -23
 Unknown handler or cannot find availably one.
 
#define FSCRT_ERRCODE_TOBECONTINUED   1
 To be continued. More...
 
#define FSCRT_ERRCODE_FINISHED   2
 Current process has finished, need not do again.
 
#define FSCRT_ERRCODE_ROLLBACK   3
 To rollback the application process.
 
#define FSCRT_SUCCEEDED(result)   ((FS_RESULT)(result) >= 0)
 Helper macro to test for success on any result value.
 
#define FSCRT_FAILED(result)   ((FS_RESULT)(result) < 0)
 Helper macro to test for failure on any result value.
 

Macro Definitions for IDs of Variant Types

Note
Variant types are used by FSCRT_VAR::type.
#define FSCRT_VT_EMPTY   0x00000000
 Synonymous variant type ID for void.
 
#define FSCRT_VT_INT8   0x00000001
 Variant type ID for FS_INT8.
 
#define FSCRT_VT_UINT8   0x00000002
 Variant type ID for FS_UINT8.
 
#define FSCRT_VT_INT16   0x00000003
 Variant type ID for FS_INT16.
 
#define FSCRT_VT_UINT16   0x00000004
 Variant type ID for FS_UINT16.
 
#define FSCRT_VT_INT32   0x00000005
 Variant type ID for FS_INT32.
 
#define FSCRT_VT_UINT32   0x00000006
 Variant type ID for FS_UINT32.
 
#define FSCRT_VT_BOOL   0x00000007
 Variant type ID for FS_BOOL.
 
#define FSCRT_VT_FLOAT   0x00000008
 Variant type ID for FS_FLOAT.
 
#define FSCRT_VT_LPVOID   0x80000000
 Variant type ID for FS_LPVOID.
 
#define FSCRT_VT_LPINT8   (FSCRT_VT_LPVOID | FSCRT_VT_INT8)
 Variant type ID for pointer type of FS_INT8*.
 
#define FSCRT_VT_LPUINT8   (FSCRT_VT_LPVOID | FSCRT_VT_UINT8)
 Variant type ID for pointer type of FS_UINT8*.
 
#define FSCRT_VT_LPINT16   (FSCRT_VT_LPVOID | FSCRT_VT_INT16)
 Variant type ID for pointer type of FS_INT16*.
 
#define FSCRT_VT_LPUINT16   (FSCRT_VT_LPVOID | FSCRT_VT_UINT16)
 Variant type ID for pointer type of FS_UINT16*.
 
#define FSCRT_VT_LPINT32   (FSCRT_VT_LPVOID | FSCRT_VT_INT32)
 Variant type ID for pointer type of FS_INT32*.
 
#define FSCRT_VT_LPUINT32   (FSCRT_VT_LPVOID | FSCRT_VT_UINT32)
 Variant type ID for pointer type of FS_UINT32*.
 
#define FSCRT_VT_LPBOOL   (FSCRT_VT_LPVOID | FSCRT_VT_BOOL)
 Variant type ID for pointer type of FS_BOOL*.
 
#define FSCRT_VT_LPFLOAT   (FSCRT_VT_LPVOID | FSCRT_VT_FLOAT)
 Variant type ID for pointer type of FS_FLOAT*.
 
#define FSCRT_VT_CHAR   FSCRT_VT_INT8
 Synonymous variant type ID for FS_CHAR.
 
#define FSCRT_VT_BYTE   FSCRT_VT_UINT8
 Synonymous variant type ID for FS_BYTE.
 
#define FSCRT_VT_WORD   FSCRT_VT_UINT16
 Synonymous variant type ID for FS_WORD.
 
#define FSCRT_VT_RESULT   FSCRT_VT_INT32
 Synonymous variant type ID for FS_RESULT.
 
#define FSCRT_VT_DWORD   FSCRT_VT_UINT32
 Synonymous variant type ID for FS_DWORD.
 
#define FSCRT_VT_ARGB   FSCRT_VT_UINT32
 Synonymous variant type ID for FS_ARGB.
 
#define FSCRT_VT_LPSTR   FSCRT_VT_LPINT8
 Synonymous variant type ID for FS_LPSTR.
 
#define FSCRT_VT_LPCSTR   FSCRT_VT_LPINT8
 Synonymous variant type ID for FS_LPCSTR.
 
#define FSCRT_VT_LPBYTE   FSCRT_VT_LPUINT8
 Synonymous variant type ID for FS_BYTE*.
 
#define FSCRT_VT_LPWORD   FSCRT_VT_LPUINT16
 Synonymous variant type ID for FS_WORD*.
 
#define FSCRT_VT_LPRESULT   FSCRT_VT_LPINT32
 Synonymous variant type ID for FS_RESULT*.
 
#define FSCRT_VT_LPDWORD   FSCRT_VT_LPUINT32
 Synonymous variant type ID for FS_DWORD*.
 
#define FSCRT_VT_LPARGB   FSCRT_VT_LPUINT32
 Synonymous variant type ID for FS_ARGB*.
 
#define FSCRT_VT_BSTR   (FSCRT_VT_LPVOID|0x00000010)
 Synonymous variant type ID for FSCRT_BSTR.
 
#define FSCRT_VT_OBJECT   (FSCRT_VT_LPVOID|0x00001000)
 Synonymous variant type ID for common objects. Please refer more macros definitions of FSPDF_VT_OBJECT_XXX.
 

Macro Definitions for Extend of Variant Types

#define FSCRT_VT_OBJECT_LAYER   (FSCRT_VT_OBJECT|0x000000001)
 Object type ID for FSPDF_LAYER.
 
#define FSCRT_VT_OBJECT_PAGEOBJECT   (FSCRT_VT_OBJECT|0x000000002)
 Object type ID for FSPDF_PAGEOBJECT.
 

Macro Definitions for File Mode

#define FSCRT_FILEMODE_WRITE   0
 Write mode. More...
 
#define FSCRT_FILEMODE_READONLY   1
 Read-only mode.
 
#define FSCRT_FILEMODE_TRUNCATE   2
 Clear existing contents, size of file is to be 0, for writing mode only.
 

Macro Definitions for License Types

Note
Foxit PDF SDK manages a license control mechanism to determine how to run for application purposes.
Applications should purchase Foxit PDF SDK license and apply unlock key and code before accessing functions.
#define FSCRT_LICENSETYPE_INVALID   FSCRT_ERRCODE_INVALIDLICENSE
 Invalid license. More...
 
#define FSCRT_LICENSETYPE_AUTHORIZED   0
 Authorized license. More...
 
#define FSCRT_LICENSETYPE_EVALUATION   1
 Evaluation license. More...
 
#define FSCRT_LICENSETYPE_EXPIRED   2
 Expired license. More...
 

Macro Definitions for Path Point Types

#define FSCRT_POINTTYPE_CLOSEFIGURE   1
 Point type of Close Figure. More...
 
#define FSCRT_POINTTYPE_LINETO   2
 Point type of Line To. More...
 
#define FSCRT_POINTTYPE_BEZIERTO   4
 Point type of Bezier To. More...
 
#define FSCRT_POINTTYPE_MOVETO   6
 Point type of Move To. More...
 

Macro Definitions for Filling Mode Types

#define FSCRT_FILLMODE_NONE   0
 No fill color.
 
#define FSCRT_FILLMODE_ALTERNATE   1
 Alternate fill mode. More...
 
#define FSCRT_FILLMODE_WINDING   2
 Winding fill mode. More...
 

Macro Definitions for Document Types

Note
FSCRT_DOCUMENT is a common document type, and a document object may be a different type, such as PDF document, ePub document.
Call function FSCRT_Doc_GetType to get a document type.
#define FSCRT_DOCUMENTTYPE_PDF   1
 PDF document type.
 
#define FSCRT_DOCUMENTTYPE_FDF   2
 FDF document type.
 
#define FSCRT_DOCUMENTTYPE_XFDF   3
 XFDF document type.
 

Macro Definitions for Font Styles.

#define FSCRT_FONTSTYLE_FIXEDPITCH   1
 Fixed pitch.
 
#define FSCRT_FONTSTYLE_SERIF   2
 Serif.
 
#define FSCRT_FONTSTYLE_SYMBOLIC   4
 Symbolic.
 
#define FSCRT_FONTSTYLE_SCRIPT   8
 Script.
 
#define FSCRT_FONTSTYLE_NONSYMBOLIC   32
 Non-symbolic.
 
#define FSCRT_FONTSTYLE_ITALIC   64
 Italic.
 
#define FSCRT_FONTSTYLE_ALLCAP   0x10000
 All cap.
 
#define FSCRT_FONTSTYLE_SMALLCAP   0x20000
 Small cap.
 
#define FSCRT_FONTSTYLE_BOLD   0x40000
 Force bold.
 

Macro Definitions for Standard Font ID

#define FSCRT_STDFONT_COURIER   0
 Courier.
 
#define FSCRT_STDFONT_COURIER_B   1
 Bold. Courier-Bold.
 
#define FSCRT_STDFONT_COURIER_BI   2
 Bold italic. Courier-BoldOblique.
 
#define FSCRT_STDFONT_COURIER_I   3
 Italic. Courier-Oblique.
 
#define FSCRT_STDFONT_HELVETICA   4
 Helvetica.
 
#define FSCRT_STDFONT_HELVETICA_B   5
 Bold. Helvetica-Bold.
 
#define FSCRT_STDFONT_HELVETICA_BI   6
 Bold italic. Helvetica-BoldOblique.
 
#define FSCRT_STDFONT_HELVETICA_I   7
 Italic. Helvetica-Oblique.
 
#define FSCRT_STDFONT_TIMES   8
 Times-Roman.
 
#define FSCRT_STDFONT_TIMES_B   9
 Bold. Times-Bold.
 
#define FSCRT_STDFONT_TIMES_BI   10
 Bold italic. Times-BoldItalic.
 
#define FSCRT_STDFONT_TIMES_I   11
 Italic. Times-Italic.
 
#define FSCRT_STDFONT_SYMBOL   12
 Symbol.
 
#define FSCRT_STDFONT_ZAPFDINGBATS   13
 ZapfDingbats.
 

Macro Definitions for Charsets

Note
Charsets are same as defined in Windows.
#define FSCRT_CHARSET_ANSI   0
 ANSI (United States, Western Europe).
 
#define FSCRT_CHARSET_DEFAULT   1
 System default, for unknown or mapping purpose.
 
#define FSCRT_CHARSET_SYMBOL   2
 Standard symbols.
 
#define FSCRT_CHARSET_SHIFTJIS   128
 Japanese (Shift-JIS).
 
#define FSCRT_CHARSET_HANGEUL   129
 Korean (Wansung).
 
#define FSCRT_CHARSET_GB2312   134
 Simplified Chinese.
 
#define FSCRT_CHARSET_CHINESEBIG5   136
 Traditional Chinese.
 
#define FSCRT_CHARSET_THAI   222
 Thai.
 
#define FSCRT_CHARSET_EASTEUROPE   238
 Eastern European.
 
#define FSCRT_CHARSET_RUSSIAN   204
 Russian.
 
#define FSCRT_CHARSET_GREEK   161
 Greek.
 
#define FSCRT_CHARSET_TURKISH   162
 Turkish.
 
#define FSCRT_CHARSET_HEBREW   177
 Hebrew.
 
#define FSCRT_CHARSET_ARABIC   178
 Arabic.
 
#define FSCRT_CHARSET_BALTIC   186
 Baltic.
 

Macro Definitions for Search Flags

#define FSCRT_SEARCHFLAG_MATCHCASE   1
 Whether is it a matching case.
 
#define FSCRT_SEARCHFLAG_MATCHWHOLEWORD   2
 Whether is it a matching whole word.
 
#define FSCRT_SEARCHFLAG_CONSECUTIVE   4
 Whether matching consecutively (for example, "CC" will match twice in "CCC").
 

Macro Definitions for Encryption Algorithm.

#define FSCRT_CIPHER_NONE   0
 Not use encryption algorithm.
 
#define FSCRT_CIPHER_RC4   1
 Use RC4 encryption algorithm, with the key length between 5-bytes and 16-bytes.
 
#define FSCRT_CIPHER_AES   2
 Use AES encryption algorithm, with the key length be 16-bytes or 32-bytes.
 

Macro Definitions for Object Type

#define FSCRT_OBJECTTYPE_UNKNOWN   0
 Unknown type.
 
#define FSCRT_OBJECTTYPE_DOCUMENT   1
 Document type.
 
#define FSCRT_OBJECTTYPE_SECTION   2
 Section type.
 
#define FSCRT_OBJECTTYPE_PAGE   3
 Page type.
 
#define FSCRT_OBJECTTYPE_ANNOT   4
 Annotation type.
 
#define FSCRT_OBJECTTYPE_FORM   5
 Form type.
 
#define FSCRT_OBJECTTYPE_FORMFIELD   6
 Form field type.
 
#define FSCRT_OBJECTTYPE_FORMCONTROL   7
 Form control type.
 
#define FSCRT_OBJECTTYPE_SIGNATURE   8
 Signature type.
 
#define FSCRT_OBJECTTYPE_PSI   9
 Pressure sensitive ink type.
 

Macro Definitions for Page Rotation

#define FSCRT_PAGEROTATION_0   0
 No rotation.
 
#define FSCRT_PAGEROTATION_90   1
 Rotate 90 degrees in clockwise direction.
 
#define FSCRT_PAGEROTATION_180   2
 Rotate 180 degrees in clockwise direction.
 
#define FSCRT_PAGEROTATION_270   3
 Rotate 270 degrees in clockwise direction.
 

Macro Definitions for Language

#define FSCRT_LANGUAGE_UNK   0
 Unknown language.
 
#define FSCRT_LANGUAGE_CHS   1
 Chinese Simplified.
 
#define FSCRT_LANGUAGE_CHT   2
 Chinese Traditional.
 
#define FSCRT_LANGUAGE_DAN   3
 Danish.
 
#define FSCRT_LANGUAGE_DEU   4
 German.
 
#define FSCRT_LANGUAGE_ENU   5
 English.
 
#define FSCRT_LANGUAGE_ESP   6
 Spanish.
 
#define FSCRT_LANGUAGE_FRA   7
 French.
 
#define FSCRT_LANGUAGE_ITA   8
 Italian.
 
#define FSCRT_LANGUAGE_KOR   9
 Korean.
 
#define FSCRT_LANGUAGE_JPN   10
 Japanese.
 
#define FSCRT_LANGUAGE_NLD   11
 Dutch.
 
#define FSCRT_LANGUAGE_NOR   12
 Norwegian.
 
#define FSCRT_LANGUAGE_PTB   13
 Brazilian Portuguese.
 
#define FSCRT_LANGUAGE_SUO   14
 Finnish.
 
#define FSCRT_LANGUAGE_SVE   15
 Swedish.
 

Macro Definitions for Digest Algorithm Types

#define FSCRT_DIGEST_MD5   1
 For MD5 algorithm that generates 128 bits digest.
 
#define FSCRT_DIGEST_SHA1   2
 For SHA1 algorithm that generates 128 bits digest.
 
#define FSCRT_DIGEST_SHA256   3
 For SHA256 algorithm that generates 256 bits digest.
 
#define FSCRT_DIGEST_SHA384   4
 For SHA384 algorithm that generates 384 bits digest.
 
#define FSCRT_DIGEST_SHA512   5
 For SHA512 algorithm that generates 512 bits digest.
 

Detailed Description

Base data structure and operation definitions for Foxit PDF SDK.
Definitions and functions in this module are included in fs_base_r.h and fs_codec_r.h.
Module: Base
License Identifier: Base/All
Available License Right: unnecessary.

Base definitions for whole Foxit PDF SDK.
Definitions and functions in this module are included in fs_base_r.h and fs_codec_r.h.
Module: Base
License Identifier: Base/All
Available License Right: Unnecessary.

This module contains following features:

This module contains the following features:

Macro Definition Documentation

#define FSCRT_BStr_Copy (   dstStr,
  srcStr 
)    FSCRT_BStr_Set(dstStr, (srcStr)->str, (srcStr)->len)

Macro to copy string value.

Note
This macro defines a copy operation between FSCRT_BSTR and the others.
Here are examples:
1 FSCRT_BSTR str1;
2 FSCRT_BStr_InitConstString(str1, "First String Data");
3 FSCRT_BStr_InitConstString(str1, "Second String Data");
4 
5 FSCRT_BSTR str2;
6 FSCRT_BStr_Init(&str2);
7 FSCRT_BStr_SetConstString(&str2, "Third String Data");
8 FSCRT_BStr_Copy(&str2, &str1);
9 FSCRT_BStr_Clear(&str2);
#define FSCRT_BStr_InitConstString (   v,
 
)    (v).str = s, (v).len = sizeof(s) - 1;

Macro to initialize constant string value.The encoding of string should be UTF-8 compatible.

Note
This macro sets constant string value to a FSCRT_BSTR directly.
Here are examples:
1 FSCRT_BSTR key;
2 FSCRT_BStr_InitConstString(key, "Author");
#define FSCRT_BStr_SetConstString (   bstr,
  str 
)    FSCRT_BStr_Set(bstr, str, sizeof(str) - 1)

Macro to set constant string value.

Note
This macro sets constant string value to a FSCRT_BSTR object direct.
Here are examples:
1 FSCRT_BSTR str2;
2 FSCRT_BStr_Init(&str2);
3 FSCRT_BStr_SetConstString(&str2, "Third String Data");
4 FSCRT_BStr_Clear(&str2);
#define FSCRT_BSTRC (   v,
  str 
)    FSCRT_BSTR v = FSCRT_BSTRD(str)

Macro to construct a byte string with constant string value.The encoding of string should be UTF-8 compatible.

Note
Here are examples:
1 FSCRT_DOCUMENT pdfDoc;
2 ... // load PDF document and other codes
3 FSCRT_BSTRC(key, "Author");
4 FSCRT_BSTRC(value, "Foxit PDF SDK");
5 FSPDF_Metadata_SetString(pdfDoc, &key, &value);
#define FSCRT_BSTRD (   str)    {str, sizeof(str) - 1}

Macro to construct a byte string with constant string value.The encoding of string should be UTF-8 compatible.

Note
Here are examples:
1 FSCRT_DOCUMENT pdfDoc;
2 ... // load PDF document and other codes
3 FSCRT_BSTR key = FSCRT_BSTRD("Author");
4 FSCRT_BSTR value = FSCRT_BSTRD("Foxit PDF SDK");
5 FSPDF_Metadata_SetString(pdfDoc, &key, &value);
#define FSCRT_ERRCODE_TOBECONTINUED   1

To be continued.

Note
It is used under progressive calls, and tells caller to call function FSCRT_Progress_Continue again.
#define FSCRT_FILEMODE_WRITE   0

Write mode.

If the file does not exist, it will be created automatically. However, if the file exists, the content will be appended to the end of the file.

#define FSCRT_FILLMODE_ALTERNATE   1

Alternate fill mode.

Represent a fill mode in which the system fills this area between odd-numbered and even-numbered polygon sides on each scan line.

#define FSCRT_FILLMODE_WINDING   2

Winding fill mode.

Represent a fill mode in which the system uses a direction in which a figure is drawn to determine whether to fill an area.

#define FSCRT_LICENSETYPE_AUTHORIZED   0

Authorized license.

This means applications can use Foxit PDF SDK normally.

#define FSCRT_LICENSETYPE_EVALUATION   1

Evaluation license.

This means applications are using an evaluation version of Foxit PDF SDK.

#define FSCRT_LICENSETYPE_EXPIRED   2

Expired license.

If applications use Foxit PDF SDK in the expired condition, please contact Foxit Software Inc. to get a legal license.

#define FSCRT_LICENSETYPE_INVALID   FSCRT_ERRCODE_INVALIDLICENSE

Invalid license.

This means applications do not call the function FSCRT_License_UnlockLibrary or license key/code is incorrect.

#define FSCRT_POINTTYPE_BEZIERTO   4

Point type of Bezier To.

Specifies that this point is a control point or ending point for a Bezier spline. When for last point of a figure, this should be used with FSCRT_POINTTYPE_CLOSEFIGURE.

#define FSCRT_POINTTYPE_CLOSEFIGURE   1

Point type of Close Figure.

Specify that a figure is automatically closed after the corresponding line or curve is drawn. The figure is closed by drawing a line from the line or curve endpoint to the point corresponding to the last FSCRT_POINTTYPE_MOVETO. Usually, this flag is not recommended to be used alone. It's better to use this flag with FSCRT_POINTTYPE_LINETO or FSCRT_POINTTYPE_BEZIERTO for tha last point of a path.
If this flag is used alone for a point, in fact that point will be useless. In this case, this flag will also be added to the previous point in order to close the figure.

#define FSCRT_POINTTYPE_LINETO   2

Point type of Line To.

Specify that a line is to be drawn from the current position to this point, which becomes a new current position. When for last point of a figure, this should be used with FSCRT_POINTTYPE_CLOSEFIGURE.

#define FSCRT_POINTTYPE_MOVETO   6

Point type of Move To.

Specify that this point starts a figure. This point becomes a new current position. Usually, this flag is used alone for the first point of a new figure.

#define FSCRT_Var_SetBooleanPtrValue (   variant,
  value 
)    (variant).type = FSCRT_VT_LPBOOL, (variant).var.boolPtrVar = (value);

Macro to set FS_BOOL pointer for a FSCRT_VAR structure.

Note
Here are examples:
1 FS_BOOL key = TRUE;
2 FSCRT_VAR val;
3 FSCRT_Var_SetBooleanPtrValue(val, &key);
#define FSCRT_Var_SetBooleanValue (   variant,
  value 
)    (variant).type = FSCRT_VT_BOOL, (variant).var.boolVar = (value);

Macro to set FS_BOOL value for a FSCRT_VAR structure.

Note
Here are examples:
1 FSCRT_VAR val;
2 FSCRT_Var_SetBooleanValue(val, TRUE);
#define FSCRT_Var_SetFloatPtrValue (   variant,
  value 
)    (variant).type = FSCRT_VT_LPFLOAT, (variant).var.floatPtrVar = (value);

Macro to set FS_FLOAT pointer for a FSCRT_VAR structure.

Note
Here are examples:
1 FS_FLOAT key = 1.0;
2 FSCRT_VAR val;
3 FSCRT_Var_SetFloatPtrValue(val, &key);
#define FSCRT_Var_SetFloatValue (   variant,
  value 
)    (variant).type = FSCRT_VT_FLOAT, (variant).var.floatVar = (value);

Macro to set FS_FLOAT value for a FSCRT_VAR structure.

Note
Here are examples:
1 FSCRT_VAR val;
2 FSCRT_Var_SetFloatValue(val, 1.0);
#define FSCRT_Var_SetInt16PtrValue (   variant,
  value 
)    (variant).type = FSCRT_VT_LPINT16, (variant).var.int16PtrVar = (value);

Macro to set FS_INT16 pointer for a FSCRT_VAR structure.

Note
Here are examples:
1 FS_INT16 key = 1;
2 FSCRT_VAR val;
3 FSCRT_Var_SetInt16PtrValue(val, &key);
#define FSCRT_Var_SetInt16Value (   variant,
  value 
)    (variant).type = FSCRT_VT_INT16, (variant).var.int16Var = (value);

Macro to set FS_INT16 value for a FSCRT_VAR structure.

Note
Here are examples:
1 FSCRT_VAR val;
2 FSCRT_Var_SetInt16Value(val, 1);
#define FSCRT_Var_SetInt32PtrValue (   variant,
  value 
)    (variant).type = FSCRT_VT_LPINT32, (variant).var.int32PtrVar = (value);

Macro to set FS_INT32 pointer for a FSCRT_VAR structure.

Note
Here are examples:
1 FS_INT32 key = 1;
2 FSCRT_VAR val;
3 FSCRT_Var_SetInt32PtrValue(val, &key);
#define FSCRT_Var_SetInt32Value (   variant,
  value 
)    (variant).type = FSCRT_VT_INT32, (variant).var.int32Var = (value);

Macro to set FS_INT32 value for a FSCRT_VAR structure.

Note
Here are examples:
1 FSCRT_VAR val;
2 FSCRT_Var_SetInt32Value(val, 1);
#define FSCRT_Var_SetInt8PtrValue (   variant,
  value 
)    (variant).type = FSCRT_VT_LPINT8, (variant).var.int8PtrVar = (value);

Macro to set FS_INT8 pointer for a FSCRT_VAR structure.

Note
Here are examples:
1 FS_INT8 key = 1;
2 FSCRT_VAR val;
3 FSCRT_Var_SetInt8PtrValue(val, &key);
#define FSCRT_Var_SetInt8Value (   variant,
  value 
)    (variant).type = FSCRT_VT_INT8, (variant).var.int8Var = (value);

Macro to set FS_INT8 value for a FSCRT_VAR structure.

Note
Here are examples:
1 FSCRT_VAR val;
2 FSCRT_Var_SetInt8Value(val, 1);
#define FSCRT_Var_SetUInt16PtrValue (   variant,
  value 
)    (variant).type = FSCRT_VT_LPUINT16, (variant).var.uint16PtrVar = (value);

Macro to set FS_UINT16 pointer for a FSCRT_VAR structure.

Note
Here are examples:
1 FS_UINT16 key = 1;
2 FSCRT_VAR val;
3 FSCRT_Var_SetUInt16PtrValue(val, &key);
#define FSCRT_Var_SetUInt16Value (   variant,
  value 
)    (variant).type = FSCRT_VT_UINT16, (variant).var.uint16Var = (value);

Macro to set FS_UINT16 value for a FSCRT_VAR structure.

Note
Here are examples:
1 FSCRT_VAR val;
2 FSCRT_Var_SetUInt16Value(val, 1);
#define FSCRT_Var_SetUInt32PtrValue (   variant,
  value 
)    (variant).type = FSCRT_VT_LPUINT32, (variant).var.uint32PtrVar = (value);

Macro to set FS_UINT32 pointer for a FSCRT_VAR structure.

Note
Here are examples:
1 FS_UINT32 key = 1;
2 FSCRT_VAR val;
3 FSCRT_Var_SetUInt32PtrValue(val, &key);
#define FSCRT_Var_SetUInt32Value (   variant,
  value 
)    (variant).type = FSCRT_VT_UINT32, (variant).var.uint32Var = (value);

Macro to set FS_UINT32 value for a FSCRT_VAR structure.

Note
Here are examples:
1 FSCRT_VAR val;
2 FSCRT_Var_SetUInt32Value(val, 1);
#define FSCRT_Var_SetUInt8PtrValue (   variant,
  value 
)    (variant).type = FSCRT_VT_LPUINT8, (variant).var.uint8PtrVar = (value);

Macro to set FS_UINT8 pointer for a FSCRT_VAR structure.

Note
Here are examples:
1 FS_UINT8 key = 1;
2 FSCRT_VAR val;
3 FSCRT_Var_SetUInt8PtrValue(val, &key);
#define FSCRT_Var_SetUInt8Value (   variant,
  value 
)    (variant).type = FSCRT_VT_UINT8, (variant).var.uint8Var = (value);

Macro to set FS_UINT8 value for a FSCRT_VAR structure.

Note
Here are examples:
1 FSCRT_VAR val;
2 FSCRT_Var_SetUInt8Value(val, 1);
#define FSCRT_Var_SetVoidPtrValue (   variant,
  value 
)    (variant).type = FSCRT_VT_LPVOID, (variant).var.voidPtrVar = (value);

Macro to set FS_LPVOID value for a FSCRT_VAR structure.

Note
Here are examples:
1 FSCRT_VAR val;
2 FSCRT_Var_SetVoidPtrValue(val, NULL);

Typedef Documentation

typedef void(* FSCRT_CALLBACK_FREEPRIVATEDATA) (FS_LPVOID data)

A callback function to free private data.

Parameters
[in]dataPointer to private data to be freed.
Returns
None.
Note
This callback is used as a paramter in the function FSCRT_Library_SetPrivateData. It will be called automatically to free private data in management.
If there is no need to free private data, just pass NULL to the function FSCRT_Library_SetPrivateData. When the function FSCRT_Library_RemovePrivateData is called to remove private data and the specified callback function here is not called, Foxit PDF SDK assumes applications could process.
typedef void(* FSCRT_CALLBACK_THREADFINALIZE) (FSCRT_THREAD thread)

A callback function definition for finalizing a thread.

Parameters
[in]threadPointer to a FSCRT_THREAD object which is the current thread handle.
Returns
None.
Note
This callback function is used by the callback function FSCRT_THREADHANDLER::SetThreadFinalizeCallback.
Threads are maintained by applications, and Foxit PDF SDK does not care how many threads are running in an application at one time.
But Foxit PDF SDK needs to access thread associated data which are maintained by Foxit PDF SDK internally.
Foxit PDF SDK will pass a callback function to FSCRT_THREADHANDLER::SetThreadFinalizeCallback to release thread associated data.

Function Documentation

FS_RESULT FSCRT_Annot_GetPage ( FSCRT_ANNOT  annot,
FSCRT_PAGE *  page 
)

Get a page handle related to an annotation. Only support PDF annotation.

Parameters
[in]annotHandle to a FSCRT_ANNOT object which is an annotation object. An annotation is an element of a page.
[out]pagePointer to a FSCRT_PAGE handle that receives a handle of page associated with the parameter annot.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter annot or page is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
This function works when the "PDF Annotation" module is authorized.
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.
  • annot: this handle is short-term.
  • page: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Archive_Create ( FSCRT_ARCHIVE *  archive)

Create an archive object for serializing and de-serializing.

Parameters
[out]archivePointer to a FSCRT_ARCHIVE handle that receives a handle of file object. If there is any errors, it will be set NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter archive is 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 recoverable.
  • archive: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Archive_GetData ( FSCRT_ARCHIVE  archive,
FSCRT_BSTR data 
)

Get data from an archive object.

Parameters
[in]archiveHandle to a FSCRT_ARCHIVE object.
[out]dataPointer to a FSCRT_BSTR structure that receives memory data from an archive object.
It shall be released by function FSCRT_BStr_Clear.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter archive or data is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if it fails for other reasons.
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.
  • archive: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Archive_LoadData ( FSCRT_ARCHIVE  archive,
const FSCRT_BSTR data 
)

Load data to an archive object.

Parameters
[in]archiveHandle to a FSCRT_ARCHIVE object.
[in]dataPointer to a FSCRT_BSTR object which represents data to be loaded to an archive object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter archive or data is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if it fails for other reasons.
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.
  • archive: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Archive_Release ( FSCRT_ARCHIVE  archive)

Release an archive handle.

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

Helper function to release the array.

Parameters
[in]arrayPointer to a array, it shall be a valid pointer to FSCRT_ARRAY.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter array is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
This function would only release the array data buffer, and it will not release the data member of array. For example, suppose that the data type is FSCRT_VT_BSTR, before calling this function, caller should call function FSCRT_BStr_Clear to free the memory for each member of the array when they are not used 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 FSCRT_Array_Init ( FSCRT_ARRAY array,
FS_INT32  dataType 
)

Helper function to initialize array.

Parameters
[in]arrayPointer to a array, it shall be a valid pointer to FSCRT_ARRAY.
[in]dataTypeThe data type. Please refer to macros definition FSCRT_VT_XXXX.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter array is NULL.
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 long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Base64_DecodeToBuffer ( const FSCRT_BSTR base64Str,
FS_LPVOID  buffer,
FS_DWORD length,
FS_DWORD pos 
)

Convert a BASE-64 string into a buffer.

Parameters
[in]base64StrPointer to a valid FSCRT_BSTR structure which stores an original BASE-64 string.
[out]bufferPointer to a buffer to receive decoded binary data. It can be NULL there are not decoded data.
[in,out]lengthPointer to a FS_DWORD object receives the length of buffer.
When this function is called, it should be the size of parameter buffer in bytes.
When this function returns, it contains the real length of data stored in the parameter buffer.
This parameter cannot be NULL.
[out]posPointer to a FS_DWORD object that receives the index position of FSCRT_BSTR::str, in bytes, indicating wrong byte position which is incompatible with BASE-64 format in parameter base64Str.
It is limited by the value of FSCRT_BSTR::len in the parameter base64Str. Pass NULL to this parameter to ignore it.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter base64Str or length is NULL.
FSCRT_ERRCODE_FORMAT if it is not a BASE-64 byte string in the parameter base64Str.
FSCRT_ERRCODE_BUFFEROVERFLOW if the parameter length is less than the required length when the parameter buffer is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
BASE-64 is an industrial standard to encode any 3-byte binary data into 4 normal ASCII codes.
Usually, this function is called twice, pass NULL to the parameter buffer first to retrieve buffer size, and call it again when the parameter buffer got from the first calling. The parameter length shall not be be empty.
Applications can call this function consecutively to decode a large amount of BASE-64 data. Ensure FSCRT_BSTR::len can be divided by 4 (four BASE-64 ASCII codes) exactly in previous calls, and pass all the remaining data in the last call, last equal signs ('=') will be omitted.
Return FSCRT_ERRCODE_FORMAT if the parameter base64Str contains incorrect format bytes and the error position is saved in the parameter pos.
It is necessary for applications to prepare buffer before calling this function.
Attention
Thread Safety: this function is not thread safe. It may cause unexpected errors when the same object is handled by multiple threads. Applications shall maintain thread safety in this scenario.
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 FSCRT_Base64_EncodeFromBuffer ( FSCRT_BSTR base64Str,
FS_LPCVOID  buffer,
FS_DWORD  length 
)

Encode a buffer into a BASE-64 string.

Parameters
[out]base64StrPointer to a valid FSCRT_BSTR structure that receives a BASE-64 encoded string.
[in]bufferAny binary data buffer, it shall not be NULL.
[in]lengthLength of parameter buffer, in bytes.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter base64Str or buffer is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
BASE-64 is an industrial standard to encode any 3-byte binary data into 4 normal ASCII codes.
One or two equal signs ('=') will be appended if the parameter length can not be divided by 3 (three bytes) exactly.
This function will call the function FSCRT_Memory_Alloc or FSCRT_Memory_Realloc to allocate or reallocate memory to store BASE-64 string data in the parameter base64Str.
It is necessary for applications to prepare buffer before calling this function.
Attention
Thread Safety: this function is not thread safe. It may cause unexpected errors when the same object is handled by multiple threads. Applications shall maintain thread safety in this scenario.
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 FSCRT_BStr_Clear ( FSCRT_BSTR bstr)

Helper function to clear a byte string.

Parameters
[in]bstrPointer to a byte string, it shall be a valid pointer to FSCRT_BSTR.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter bstr is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
This helper function is used to clear string buffer after calling the function FSCRT_BStr_SetLength or FSCRT_BStr_Set.
It frees FSCRT_BSTR::str and sets it to NULL, and then sets FSCRT_BSTR::len to 0.
Applications can free FSCRT_BSTR by themselves instead of calling this function.
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 FSCRT_BStr_Init ( FSCRT_BSTR bstr)

Helper function to initialize a byte string.

Parameters
[in]bstrPointer to a byte string, it shall be a valid pointer to FSCRT_BSTR.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter bstr is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
This helper function is used to initialize a byte string variant.
It sets FSCRT_BSTR::str to a NULL pointer, and sets FSCRT_BSTR::len to 0.
Applications can initialize FSCRT_BSTR in other ways instead of calling this function.
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 FSCRT_BStr_Set ( FSCRT_BSTR bstr,
FS_LPCSTR  str,
FS_DWORD  length 
)

Helper function to set string data.

Parameters
[in]bstrPointer to a byte string, it shall be a valid pointer to FSCRT_BSTR.
[in]strPointer to a constant string buffer.
[in]lengthLength of the parameter str, in bytes. If this parameter is -1, str is treated as a null-terminated string.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter bstr is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
This helper function is used to set new string data.
It calls FSCRT_BStr_Clear if the parameter str is NULL or length is 0, or calls FSCRT_BStr_SetLength to prepare buffer and data.
Please note the difference between FSCRT_BStr_InitConstString and FSCRT_BStr_SetConstString: the first one has no private memory block, but the second one has private memory block.
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 FSCRT_BStr_SetLength ( FSCRT_BSTR bstr,
FS_DWORD  length 
)

Helper function to set length of a byte string.

Parameters
[in]bstrPointer to a byte string, it shall be a valid pointer to FSCRT_BSTR.
[in]lengthNew length of byte string, in bytes.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter bstr is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
This helper function is used to reset the length of byte string.
It allocates string buffer if FSCRT_BSTR::str is NULL or reallocates if FSCRT_BSTR::str is not NULL and
FSCRT_BSTR::len is less than the parameter length, and then sets FSCRT_BSTR::len to the parameter length.
Setting 0 to length has the same action as function FSCRT_BStr_Clear.
Applications can reset a byte string instead of calling this function.
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 FSCRT_Digest_Finish ( FSCRT_DIGEST  digest,
FSCRT_BSTR hash 
)

Finish the process and output the digest.

Parameters
[in]digestHandle to a FSCRT_DIGEST object.
[out]hashPointer to a FSCRT_BSTR structure that receives the hash value.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter digest or hash is a NULL pointer.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or if the memory access is wrong.
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 to process same objects between multi-threads, or the application should maintain thread safety when it needs to process same objects under multi-threaded environments.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • digest: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Digest_Start ( FS_INT32  digestType,
FSCRT_DIGEST *  digest 
)

Setup a DIGEST context.

Parameters
[in]digestTypeThe specified DIGEST algorithm type. Please refer to macro definitions FSCRT_DIGEST_XXX and this should be one of these macros.
[out]digestPointer to a FSCRT_DIGEST handle that receives a new DIGEST object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter digest is NULL.
FSCRT_ERRCODE_NOTFOUND if the parameter digestType is invalid.
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 to process same objects between multi-threads, or applications should maintain thread safety when it needs to process same objects under multi-threaded environments.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • digest: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Digest_Update ( FSCRT_DIGEST  digest,
FS_LPVOID  buf,
FS_DWORD  size 
)

Update the DIGEST with some new data. Function FSCRT_Digest_Start must be called before.

Parameters
[in]digestHandle to a FSCRT_DIGEST object returned by function FSCRT_Digest_Start.
[in]bufPointer to the data buffer. The buffer will be replaced with encrypted/decrypted data.
[in]sizenumber of bytes in the data buffer.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter digest or buf is a NULL pointer. Additionally, parameter size which is set improperly can be used to receive the error.
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 to process same objects between multi-threads, or the application should maintain thread safety when it needs to process same objects under multi-threaded environments.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • digest: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Doc_GetType ( FSCRT_DOCUMENT  document,
FS_INT32 docType 
)

Get a document type.

Parameters
[in]documentHandle to a FSCRT_DOCUMENT object which is a document object.
[out]docTypePointer to a FS_INT32 object that receives document type value.
Please refer to macro definitions FSCRT_DOCUMENTTYPE_XXX and this would be one of these macros.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter document or docType 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.
  • document: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_File_ClearRange ( FSCRT_FILE  file)

Clear the reading range of file object, the current reading position will not be affected.

If function FSCRT_File_SetRange is called to read the file content from the specific range, then you might call FSCRT_File_ClearRange to clear the range, or the following reading from file would be restricted in the range.

Parameters
[in]fileHandle to a FSCRT_FILE object which is a handle of file object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter file 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.
  • file: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_File_Create ( FSCRT_FILEHANDLER fileStream,
FSCRT_FILE *  file 
)

Create a file object from file stream.

In order to provide uniform file accessing mechanism, Foxit PDF SDK does not use FSCRT_FILEHANDLER directly to access stream data.
FSCRT_FILE is used to represent a stream source and gives callers a normal way. The FSCRT_FILE object can be created from different manners.

Parameters
[in]fileStreamPointer to a valid FSCRT_FILEHANDLER structure to create a file object.
[out]filePointer to a FSCRT_FILE handle that receives the handle of file object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter fileStream or parameter file is NULL.
FSCRT_ERRCODE_HANDLER if any one callback functions in parameter fileStream is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Foxit PDF SDK does not distinguish reading or writing mode explicitly, applications or implementers of FSCRT_FILEHANDLER structure can determine this by application intentions.
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.
  • file: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_File_Create_L ( FSCRT_FILEHANDLER_L fileStream,
FSCRT_FILE *  file 
)

Create a FSCRT_FILE object from a large file, which the file size could be over 2GB.

In order to provide uniform file accessing mechanism, Foxit PDF SDK does not use FSCRT_FILEHANDLER_L directly to access stream data.
FSCRT_FILE is used to represent a stream source and gives callers a normal way. The FSCRT_FILE object can be created from many different manners.

Parameters
[in]fileStreamPointer to a valid FSCRT_FILEHANDLER_L structure to create a large file object.
[out]filePointer to a FSCRT_FILE handle that receives the handle of file object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter fileStream or parameter file is NULL.
FSCRT_ERRCODE_HANDLER if any callback functions in parameter fileStream is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Foxit PDF SDK does not distinguish reading or writing mode explicitly, applications or implementers of FSCRT_FILEHANDLER_L structure can determine this by application intentions.
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.
  • file: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_File_CreateCacheFile ( FSCRT_FILEHANDLER fileStream,
FS_DWORD  chunkSize,
FS_DWORD  chunkCount,
FS_LPVOID  buffer,
FSCRT_FILE *  file 
)

Create a cached file object from file stream.

In order to provide uniform file accessing mechanism, Foxit PDF SDK does not use FSCRT_FILEHANDLER directly to access stream data.
FSCRT_FILE is used to represent a stream source and gives callers a normal way.FSCRT_FILEobject can be created from different manners.
In some environments, file accessing is slow. Using file cache can increase efficiency significantly. This function is designed for this purpose.
File cache consists of a set of chunks. A chunk is a memory block.
A cached file is only for reading mode. Do not use it to write data into file object.

Parameters
[in]fileStreamPointer to a valid FSCRT_FILEHANDLER structure to create a FSCRT_FILEobject.
[in]chunkSizeChunk size, in bytes, parameter chunkSize should not be less than 4096 and not be greater than 65536.
[in]chunkCountThe number of chunks used in file cache, parameter chunkCount should not less than 1 and not be greater than 256.
[in]bufferPointer to cache buffer. If it is NULL, a new cache buffer will be allocated internally. If it is not NULL, buffer size should be not less than the amount value parameter chunkSize multiplies parameter chunkCount.
[out]filePointer to a FSCRT_FILE handle that receives the handle of file object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter fileStream or file is a NULL pointer or the values of parameter chunkSize and chunkCount exceed their ranges.
FSCRT_ERRCODE_HANDLER if any callback function in parameter fileStream is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Foxit PDF SDK does not distinguish reading or writing mode explicitly, applications or implementer of FSCRT_FILEHANDLER can determine this by application intentions.
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.
  • file: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_File_CreateFromFileName ( const FSCRT_BSTR fileName,
FS_DWORD  fileModes,
FSCRT_FILE *  file 
)

Create a file object from a specific file path.

Parameters
[in]fileNamePointer to a UTF-8 encoded string, it should be a valid pointer to FSCRT_BSTR that specifies a path of file.
[in]fileModesIndicate a file mode. It should be one of the following value:
[out]filePointer to a FSCRT_FILE handle that receives a handle of file object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter fileName or file or FSCRT_BSTR::str is NULL or FSCRT_BSTR::len is invalid.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
FSCRT_ERRCODE_FORMAT if it is not a UTF-8 byte string in the parameter fileName.
FSCRT_ERRCODE_ERROR if the function cannot create file object because of any other reasons. For exampke, a file is not existing.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Foxit PDF SDK does not distinguish reading from writing mode explicitly, it is determined by the parameter fileModes.
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.
  • file: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_File_CreateFromMemory ( FS_LPVOID  buffer,
FS_DWORD  length,
FSCRT_FILE *  file 
)

Create a memory-based file object.

Parameters
[in]bufferPointer to a memory block to access data. It should be valid.
[in]lengthSize of buffer, in bytes.
[out]filePointer to a FSCRT_FILE handle that receives the handle of file object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter buffer or file is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
The memory-based file is either for reading or writing purpose, do not write and read on the same memory-based file! The size of memory buffer is fixed:
  • For reading mode, parameter length indicates the size of data stored in parameter buffer.
  • For writing mode, parameter length is the maximum size of data can be written.
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.
  • file: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_File_GetSize ( FSCRT_FILE  file,
FSCRT_FILESIZE fileSize 
)

Get the number of bytes of a file object.

Parameters
[in]fileHandle to a FSCRT_FILE object which is a handle of file object.
[out]fileSizePointer to a FSCRT_FILESIZE structure that receives a file size. In order to keep forward compatibilities, use 64-bits here.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter file or fileSize 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.
  • file: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_File_Read ( FSCRT_FILE  file,
FS_LPVOID  buffer,
const FSCRT_FILESIZE size,
FSCRT_FILESIZE actualSize 
)

Read data from file object.

Parameters
[in]fileHandle to a FSCRT_FILE object which is a handle of file object.
[in]bufferPointer to a buffer which receives the specific data of file object.
[in]sizePointer to a FSCRT_FILESIZE structure to set the size of file object in bytes to be read. In order to keep forward compatibilities, use 64-bits here.
[out]actualSizePointer to a FSCRT_FILESIZE structure to recieve the actual size read from file object in bytes. In order to keep forward compatibilities, use 64-bits here.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter file or buffer or size or actualSize 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.
  • file: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_File_Release ( FSCRT_FILE  file)

Release a file object.

Parameters
[in]fileHandle to a FSCRT_FILE object which is a handle of file object to release.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter file is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Do not use the parameter file object in case it is released.
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.
  • file: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_File_SetRange ( FSCRT_FILE  file,
const FSCRT_FILESIZE offset,
const FSCRT_FILESIZE length 
)

Set reading range of file object, the following reading from file would be restricted in this range.

In some cases, such as opening a PDF wrapper file, this function is used for applications to change reading range of file.
This function works in reading mode rather than writing purpose.

Parameters
[in]fileHandle to a FSCRT_FILE object which is a handle of file object.
[in]offsetPointer to a FSCRT_FILESIZE structure to set the starting position of file object in bytes. In order to keep forward compatibilities, use 64-bits here.
[in]lengthPointer to a FSCRT_FILESIZE structure to set the new reading length of file object in bytes. In order to keep forward compatibilities, use 64-bits here.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter file or offset or length is NULL, or parameter offset is out of the file size range.
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.
  • file: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_File_Write ( FSCRT_FILE  file,
FS_LPVOID  buffer,
const FSCRT_FILESIZE size 
)

Write data to file object.

Parameters
[in]fileHandle to a FSCRT_FILE object which is a handle of file object.
[in]bufferPointer to a buffer to save data which will be written to file object.
[in]sizePointer to a FSCRT_FILESIZE structure to set the size of file object in bytes to be written. In order to keep forward compatibilities, use 64-bits here.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter file or buffer or size is a NULL pointer.
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.
  • file: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Flate_Compress ( const FSCRT_BSTR src,
FSCRT_BSTR dst 
)

Compress data by using the flate algorithm.

Parameters
[in]srcPointer to a FSCRT_BSTR structure that specifies the input data.
[out]dstPointer to a FSCRT_BSTR structure that receives the compressed data.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter src or dst is a NULL pointer.
FSCRT_ERRCODE_UNRECOVERABLE if internal memory meets exception.
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 to process same objects between multi-threads, or the application should maintain thread safety when it needs to process same objects under multi-threaded 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 FSCRT_Flate_Decompress ( const FSCRT_BSTR src,
FSCRT_BSTR dst 
)

Decompress data by using the flate algorithm.

Parameters
[in]srcPointer to a FSCRT_BSTR structure that specifies the input data.
[out]dstPointer to a FSCRT_BSTR structure that receives the decompressed data.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter src or dst is a NULL pointer.
FSCRT_ERRCODE_UNRECOVERABLE if internal memory meets exception.
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 to process same objects between multi-threads, or the application should maintain thread safety when it needs to process same objects under multi-threaded 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 FSCRT_Font_Create ( const FSCRT_BSTR fontName,
FS_DWORD  fontStyles,
FS_INT32  weight,
FS_INT32  charset,
FSCRT_FONT *  font 
)

Create a font with the given attributes.

Parameters
[in]fontNamePointer to a UTF-8 encoded string, it should be a valid pointer to FSCRT_BSTR that specifies a typeface name of a given font.
[in]fontStylesThe font styles. Please refer to macro definitions of FSCRT_FONTSTYLE_XXX and this can be one or a combination of these macros.
[in]weightOriginal font weight. 0 means unspecified.
[in]charsetThe charset of the font. Please refer to macro definitions of FSCRT_CHARSET_XXX and this should be one of these macros.
[out]fontPointer to a FSCRT_FONT handle that receives a new font object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter fontName or font is NULL or other reasons.
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 fail to create a font object for other reasons, such as the private data of a font is NULL or unable to get an alternative font and so on.
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.
  • font: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Font_CreateFromFile ( FSCRT_FILE  fontFile,
FS_INT32  faceIndex,
FS_INT32  charset,
FSCRT_FONT *  font 
)

Create a font from a font file.

Parameters
[in]fontFileHandle to a FSCRT_FILE object.
[in]faceIndexThe zero-based face index, range from [0, faceCount). faceCount is returned by function FSCRT_Font_EnumFaces.
[in]charsetThe charset of the font. Please refer to macro definitions of FSCRT_CHARSET_XXX and this should be one of these macros.
[out]fontPointer to a FSCRT_FONT handle that receives a new font object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter fontFile, font is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_NOTFOUND if the parameter faceIndex is out of range.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
FSCRT_ERRCODE_ERROR if fail to create a font object for other reasons.
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.
  • fontFile: this handle is long-term recoverable.
  • font: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Font_CreateStandard ( FS_INT32  fontID,
FSCRT_FONT *  font 
)

Create a standard font by a font ID.

Parameters
[in]fontIDID of standard font. Please refer to macro definitions of FSCRT_STDFONT_XXX and this should be one of these macros.
[out]fontPointer to a FSCRT_FONT handle that receives a new font object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter font is NULL, or parameter fontID is invalid.
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 fail to create font object for other reasons, such as the private data of a font is NULL and so on.
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.
  • font: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Font_EnumFaces ( FSCRT_FILE  fontFile,
FSCRT_FONTFACE faces,
FS_INT32 count 
)

Enum faces from a font file.

Commonly this function needs to be called twice:
For the first time, set the parameter faces to be NULL to get buffer size, which will be returned by the parameter count.
Then use count to allocate faces.
For the second time, input faces with enough space and its count. When this function returns successfully, faces will receive face information.
The size of faces shall not be less than buffer size, and the parameter count shall not be empty.

Parameters
[in]fontFileHandle to a FSCRT_FILE object.
[out]facesPointer to a FSCRT_FONTFACE structure that receives faces of a font file, it can be NULL to get the parameter count.
[out]countPointer to a FS_INT32 object that receives the count of faces in a given font file.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter fontFile or count is NULL.
FSCRT_ERRCODE_FILE if fail to access the parameter fontFile.
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 fail to enumerate font faces for other reasons,such as count of faces in a font is -1.
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.
  • fontFile: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Font_GetAscent ( FSCRT_FONT  font,
FS_INT32 ascent 
)

Get an ascent value of a font.

Parameters
[in]fontHandle to a FSCRT_FONT object created by the function FSCRT_Font_CreateStandard, FSCRT_Font_Create or FSCRT_Font_CreateFromFile.
[out]ascentPointer to a FS_INT32 object receives a font ascent value.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter font or ascent is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if fail to get an ascent value for other reasons.
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.
  • font: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Font_GetCharBBox ( FSCRT_FONT  font,
FS_DWORD  unicode,
FSCRT_RECT bbox 
)

Get a specific character bounding box of a font.

Parameters
[in]fontHandle to a FSCRT_FONT object created by the function FSCRT_Font_CreateStandard, FSCRT_Font_Create or FSCRT_Font_CreateFromFile.
[in]unicodeA character unicode value.
[out]bboxPointer to a FSCRT_RECT object that receives a character bounding box.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter font or bbox is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if fail to get character bounding box for other reasons.
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.
  • font: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Font_GetCharWidth ( FSCRT_FONT  font,
FS_DWORD  unicode,
FS_FLOAT width 
)

Get a specific character width of a font.

Parameters
[in]fontHandle to a FSCRT_FONT object created by function FSCRT_Font_CreateStandard, FSCRT_Font_Create or FSCRT_Font_CreateFromFile.
[in]unicodeA character unicode value.
[out]widthPointer to a FS_FLOAT object that receives character width.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter font or width is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if fail to get character width for other reasons.
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.
  • font: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Font_GetDescent ( FSCRT_FONT  font,
FS_INT32 descent 
)

Get a descent value of a font.

Parameters
[in]fontHandle to a FSCRT_FONT object created by the function FSCRT_Font_CreateStandard, FSCRT_Font_Create or FSCRT_Font_CreateFromFile.
[out]descentPointer to a FS_INT32 object receives a font descent value.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter font or descent is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if fail to get descent value for other reasons.
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.
  • font: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Font_GetName ( FSCRT_FONT  font,
FSCRT_BSTR fontName 
)

Retrieve a face name of a font and return a name in string.

Parameters
[in]fontHandle to a FSCRT_FONT object created by the function FSCRT_Font_CreateStandard, FSCRT_Font_Create or FSCRT_Font_CreateFromFile.
[out]fontNamePointer to a UTF-8 encoded string that receives a font name, it shall be a valid pointer to FSCRT_BSTR.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter font or fontName is NULL.
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 fail to get font name for any other reasons.
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.
  • font: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Font_IsBold ( FSCRT_FONT  font,
FS_BOOL bold 
)

Judge whether a font object is bold or not.

Parameters
[in]fontHandle to a FSCRT_FONT object created by the function FSCRT_Font_CreateStandard, FSCRT_Font_Create or FSCRT_Font_CreateFromFile.
[out]boldPointer to a FS_BOOL object receives font style, that indicates if a font is bold or not.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter font or bold is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if fail to judge wheter a font is bold or not for other reasons.
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.
  • font: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Font_IsItalic ( FSCRT_FONT  font,
FS_BOOL italic 
)

Judge whether a font object is italic or not.

Parameters
[in]fontHandle to a FSCRT_FONT object created by the function FSCRT_Font_CreateStandard, FSCRT_Font_Create or FSCRT_Font_CreateFromFile.
[out]italicPointer to a FS_BOOL object receives the font style, that indicates if a font is italic or not.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter font or italic is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if fail to judge whether a font is italic or not for other reasons.
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.
  • font: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Font_Release ( FSCRT_FONT  font)

Release a font object.

Parameters
[in]fontHandle to a FSCRT_FONT object created by the function FSCRT_Font_CreateStandard, FSCRT_Font_Create or FSCRT_Font_CreateFromFile.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter font is NULL.
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 long-term recoverable.
  • font: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_AddFontFile ( FSCRT_FILE  fontFile)

Add an additional font (typically a TrueType, Type1 or CFF font) to Foxit PDF SDK library from FSCRT_FILE.

This function can be called multiple times, each time to add a font to Foxit PDF SDK Library. When calling the function FSCRT_Font_Create to create a font or display a document which has non-embedded fonts, Foxit PDF SDK Library will search a font from system fonts and also search all fonts added by this function.

Parameters
[in]fontFileHandle to a FSCRT_FILE object which is a font file to be added.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter fontFile is NULL.
FSCRT_ERRCODE_ERROR if fail to add an additional font for other reasons.
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.
  • fontFile: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_CreateDefaultMgr ( )

Create a default Foxit PDF SDK manager by applications.

This is the first function to be called by applications. Applications should call this function to initialize Foxit PDF SDK library at first.
Calling this function to use a default memory allocation strategy.

Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_FINISHED if Foxit PDF SDK manager exists.
FSCRT_ERRCODE_ERROR if Foxit PDF SDK cannot be initialized because of any other reasons.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Call this function before others, Once this function is called, caller should not invoke the function FSCRT_Library_CreateMgr.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_CreateMgr ( FS_LPVOID  memory,
FS_DWORD  size,
FSCRT_MEMMGRHANDLER memMgr 
)

Create a Foxit PDF SDK manager.

This is the first function to be called by applications. Applications should call this function to initialize Foxit PDF SDK library at first.
It will cause unexpected errors to call other functions before this one.

Parameters
[in]memoryPointer to a pre-allocated memory buffer to initialize Foxit PDF SDK. It should be valid.
[in]sizeBuffer size specified by the parameter memory, in bytes. The parameter size should be at least 8MB.
[in]memMgrPointer to a FSCRT_MEMMGRHANDLER structure to provide extensible memory management. The parameter memMgr may be NULL when no need to support extension.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_FINISHED if Foxit PDF SDK manager exists.
FSCRT_ERRCODE_PARAM if the parameter memory is NULL, or the parameter size is less than 8MB.
FSCRT_ERRCODE_ERROR if Foxit PDF SDK cannot be initialized because of any other reasons.
FSCRT_ERRCODE_HANDLER if one of the callback functions in the parameter memMgr is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or if invalid memory access.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Call this function before others. Once this function is called, applications should not invoke the function FSCRT_Library_CreateDefaultMgr.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
void FSCRT_Library_DestroyMgr ( )

Destroy the current Foxit PDF SDK manager.

This function releases all internal resources and frees the current Foxit PDF SDK manager.

Returns
None.
Note
Call this function only in the executive module in which current Foxit PDF SDK manager is created by the previous function FSCRT_Library_CreateMgr or FSCRT_Library_CreateDefaultMgr.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_EnableJavaScript ( FS_BOOL  isEnabled)

Enable or disable javascript for PDF.

Javascript for PDF is enabled by default.

Parameters
[in]isEnabledA boolean value that indicate to enable(TRUE) or disable(FALSE) javascript.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_INVALIDMANAGER if Foxit PDF SDK manager is not initialized.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_GetFixedMemSize ( FS_DWORD memSize)

Get the used memory size of the fixed memory manager in Foxit PDF SDK. Only available when a library manager is created by the function FSCRT_Library_CreateMgr.

Parameters
[out]memSizePointer to FS_DWORD object that receives the memory size of the fixed memory manager in Foxit PDF SDK.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter memSize is NULL .
FSCRT_ERRCODE_INVALIDMANAGER if the current Foxit PDF SDK manager is not initialized.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_GetMgr ( FS_LPVOID sdkMgr)

Get the current Foxit PDF SDK manager.

This function is used under multiple-executive-module environments. It is used to ensure the whole application use the same Foxit PDF SDK manager.

Parameters
[out]sdkMgrPointer to a FS_LPVOID object that receives the current Foxit PDF SDK manager.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter sdkMgr 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_GetPrivateData ( FS_LPVOID  moduleID,
FS_LPVOID data 
)

Get private data.

Parameters
[in]moduleIDPointer to specify a module ID or identity code to distinguish private data. It shall not be NULL.
[out]dataPointer to a FS_LPVOID object that receives private data. It shall not be NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter moduleID or data is NULL.
FSCRT_ERRCODE_NOTFOUND if the parameter moduleID is not found. 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_GetVersion ( FSCRT_BSTR sdkVersion)

Get the current Foxit PDF SDK version.

Parameters
[out]sdkVersionPointer to a UTF-8 encoded string that receives a version. It should be a valid pointer to FSCRT_BSTR.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter sdkVersion 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_LoadSystemFonts ( )

Load the installed local system fonts for Foxit PDF SDK.

This function is only useful for Linux, Windows 8.1 store app, WindowsPhone 8.1 and Windows 10 universal app.
And this function should be called after the library is initialized and before loading a PDF document.

Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_ERROR if fail to load system font map.
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 not recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_RemovePrivateData ( FS_LPVOID  moduleID)

Remove private data.

Parameters
[in]moduleIDPointer to specify a module ID or identity code to distinguish a private data. It shall not be NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter moduleID is NULL.
FSCRT_ERRCODE_NOTFOUND if the parameter moduleID is not found. For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
This function assumes applications free private data associated with the parameter moduleID, so if applications specify a callback function to the function FSCRT_Library_SetPrivateData, it shall be omitted here.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_SetCacheSize ( FS_DWORD  size)

Set the upper limit of PDF library cache size.

If no cache size limit is set by application, the cache size will be set to 100 MegaBytes internally by default.

Parameters
[in]sizeThe upper limit of the cache, in MegaBytes, 0~4096.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the size is greater than 4096. For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Currently, only font and image cache would be managed by this API.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_SetFontMapperHandler ( FSCRT_FONTMAPPERHANDLER fontMapperHandler)

Use a system font mapper (typically for Chinese/Japanese/Korean charsets).

This function is used for devices that come with one or more system fonts, and those fonts are in standard TrueType or Type1 format.

Parameters
[in]fontMapperHandlerPointer to a FSCRT_FONTMAPPERHANDLER structure.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter fontMapperHandler is NULL.
FSCRT_ERRCODE_HANDLER if any callback functions in the parameter fontMapperHandler is NULL.
FSCRT_ERRCODE_ERROR if a function cannot set a font mapper handler for other reasons.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_SetLogFile ( FSCRT_FILE  file)

Set a log file handle. Currently only support Windows 32-bit, and not support Windows 8.

Parameters
[in]fileHandle to a FSCRT_FILE object which is a log file. This can only be created by function FSCRT_File_Create and FSCRT_File_Create_L.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter file is NULL.
FSCRT_ERRCODE_INVALIDMANAGER if Foxit PDF SDK manager is not initialized.
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.
  • file: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_SetMgr ( FS_LPVOID  sdkMgr)

Set the current Foxit PDF SDK manager.

This function is used under multiple-executive-module environments. It is used to ensure the whole application use the same Foxit PDF SDK manager. Current Foxit PDF SDK manager is often got by the function FSCRT_Library_GetMgr.

Parameters
[in]sdkMgrPointer to Foxit PDF SDK manager.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter sdkMgr 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_SetPrivateData ( FS_LPVOID  moduleID,
FS_LPVOID  data,
FSCRT_CALLBACK_FREEPRIVATEDATA  callbackFreePrivateData 
)

Set private data.

Parameters
[in]moduleIDPointer to any module ID or identity code to distinguish private data. It shall not be NULL.
[in]dataPointer to any private data.
[in]callbackFreePrivateDataCallback function address to free private data. Pass NULL if no need to free process.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter moduleID is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Private data are a global feature in Foxit PDF SDK.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Library_SetThreadHandler ( FSCRT_THREADHANDLER threadHandler)

Set a thread handler into Foxit PDF SDK library.

Parameters
[in]threadHandlerPointer to a FSCRT_THREADHANDLER structure to support multiple-thread environments.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter threadHandler is NULL.
FSCRT_ERRCODE_HANDLER if any callback functions in the parameter threadHandler is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Call this function when applications need multiple-thread environment.
To single-thread application, no need to call this function.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_License_GetType ( FS_INT32 type)

Get the current license type.

Applications should call the function FSCRT_License_UnlockLibrary to unlock a library.
Using this function to determine which type of license can be accepted.
Please purchase authorized Foxit PDF SDK licenses.

Parameters
[out]typePointer to FS_INT32 object that receives the current license type. It would be one of the following macro definitions:
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter type is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Make sure a license is authorized before using Foxit PDF SDK library.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_License_UnlockLibrary ( const FSCRT_BSTR licenseKey,
const FSCRT_BSTR unlockCode 
)

Unlock Foxit PDF SDK library using a license key and a code.

Applications should call this function to unlock library.
This function should be called after Foxit PDF SDK manager is created and a library is initialized successfully.
Please purchase an authorized Foxit PDF SDK license.

Parameters
[in]licenseKeyPointer to a binary string (may not be a UTF-8 string here) that specifies license key value.
[in]unlockCodePointer to a binary string (may not be a UTF-8 string here) that specifies license code value.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter licenseKey or unlockCode is a NULL pointer, or their content is empty.
FSCRT_ERRCODE_FORMAT if content in the parameter licenseKey or unlockCode is invalid or inapplicable.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
To know which type of license is accepted, please call the function FSCRT_License_GetType.
Make sure a license is authorized before using Foxit PDF SDK library.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Matrix_Concat ( FSCRT_MATRIX dstMatrix,
const FSCRT_MATRIX srcMatrix 
)

Concatenate another matrix.

Parameters
[in,out]dstMatrixPointer to a FSCRT_MATRIX structure.
When this function is called, it is a matrix.
When this function returns, it receives the concatenated matrix.
[in]srcMatrixPointer to a FSCRT_MATRIX structure for source matrix.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter dstMatrix or srcMatrix 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Matrix_GetReverse ( const FSCRT_MATRIX srcMatrix,
FSCRT_MATRIX dstMatrix 
)

Get a reversed matrix.

Parameters
[in]srcMatrixPointer to a FSCRT_MATRIX structure for source matrix.
[out]dstMatrixPointer to a FSCRT_MATRIX structure that receives a reversed matrix from the parameter srcMatrix.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter srcMatrix or dstMatrix is NULL.
FSCRT_ERRCODE_ERROR if the parameter srcMatrix is not invertible.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Matrix_Rotate ( FSCRT_MATRIX matrix,
FS_FLOAT  angle 
)

Rotate a coordinate matrix.

Parameters
[in,out]matrixPointer to a FSCRT_MATRIX structure.
When this function is called, it is the source matrix.
When this function returns, it receives the rotated matrix.
[in]angleAngle of rotation, in radian.
For a coordinate in which Y-axis is downward, positive value means rotation in clockwise and negative value means rotation in counterclockwise.
If Y-axis is upward, rotation direction is inverse.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter matrix 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Matrix_Scale ( FSCRT_MATRIX matrix,
FS_FLOAT  scaleX,
FS_FLOAT  scaleY 
)

Scale a coordinate matrix.

Parameters
[in,out]matrixPointer to a FSCRT_MATRIX structure.
When this function is called, it is the source matrix.
When this function returns, it receives the scaled matrix.
[in]scaleXX-axis scale value.
[in]scaleYY-axis scale value.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter matrix 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Matrix_Shear ( FSCRT_MATRIX matrix,
FS_FLOAT  alpha,
FS_FLOAT  beta 
)

Make a shear transformation on a coordinate matrix.

Parameters
[in,out]matrixPointer to a FSCRT_MATRIX structure.
When this function is called, it is the source matrix.
When this function returns, it receives the sheared matrix.
[in]alphaX-axis shear angle, in radian.
For a coordinate in which Y-axis is downward, positive value means a clockwise shear, and negative value means a counterclockwise shear. If Y-axis is upward, shear direction is inverse.
[in]betaY-axis shear angle, in radian.
For a coordinate in which Y-axis is downward, positive value means a counterclockwise shear and negative value means a clockwise shear. If Y-axis is upward, shear direction is inverse.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter matrix 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Matrix_TransformPoint ( const FSCRT_MATRIX matrix,
FS_INT32 x,
FS_INT32 y 
)

Transform an integer point by a matrix.

Parameters
[in]matrixPointer to a FSCRT_MATRIX structure for a coordinate matrix.
[in,out]xPointer to a FS_INT32 object.
When this function is called, it means X coordinate value of point in integer
When this function returns, it is transformed by the parameter matrix.
[in,out]yPointer to a FS_INT32 object.
When this function is called, it means Y coordinate value of point in integer
When this function returns, it is transformed by the parameter matrix.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter matrix or x or y 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Matrix_TransformPointF ( const FSCRT_MATRIX matrix,
FS_FLOAT x,
FS_FLOAT y 
)

Transform a float point by a matrix.

Parameters
[in]matrixPointer to a FSCRT_MATRIX structure for a coordinate matrix.
[in,out]xPointer to a FS_FLOAT object.
When this function is called, it means X coordinate value of point in float.
When this function returns, it is transformed by the parameter matrix.
[in,out]yPointer to a FS_FLOAT object.
When this function is called, it means Y coordinate value of point in float.
When this function returns, it is transformed by the parameter matrix.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter matrix or x or y 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Matrix_TransformRect ( const FSCRT_MATRIX matrix,
FSCRT_RECT rect 
)

Transform an integer rectangle by a matrix.

Parameters
[in]matrixPointer to a FSCRT_MATRIX structure for a coordinate matrix.
[in,out]rectPointer to a FSCRT_RECT structure.
When this function is called, it means coordinate values of a rectangle in integer.
When this function returns, it is transformed by the parameter matrix.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter matrix or rect 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Matrix_TransformRectF ( const FSCRT_MATRIX matrix,
FSCRT_RECTF rect 
)

Transform a float rectangle by a matrix.

Parameters
[in]matrixPointer to a FSCRT_MATRIX structure for a coordinate matrix.
[in,out]rectPointer to a FSCRT_RECTF structure.
When this function is called, it means coordinate value of a rectangle in float.
When this function returns, it is transformed by the parameter matrix.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter matrix or rect 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Matrix_Translate ( FSCRT_MATRIX matrix,
FS_FLOAT  offsetX,
FS_FLOAT  offsetY 
)

Translate a coordinate matrix.

Parameters
[in,out]matrixPointer to a FSCRT_MATRIX structure.
When this function is called, it is the source matrix.
When this function returns, it receives the translated matrix.
[in]offsetXX value by which to translate the parameter matrix.
[in]offsetYY value by which to translate the parameter matrix.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter matrix 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Memory_Alloc ( FS_DWORD  size,
FS_LPVOID ptr 
)

Allocate a memory block.

Parameters
[in]sizenumber of bytes to be allocated.
[out]ptrPointer to a FS_LPVOID object that receives the allocated memory block.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter ptr is a NULL pointer.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or if the memory access is wrong.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
void FSCRT_Memory_Free ( FS_LPVOID  ptr)

Free a memory block.

Parameters
[in]ptrPointer to a memory block allocated by the previous functions FSCRT_Memory_Alloc or FSCRT_Memory_Realloc.
Returns
None.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Memory_Realloc ( FS_LPVOID  ptr,
FS_DWORD  newSize,
FS_LPVOID newPtr 
)

Reallocate a memory block.

Parameters
[in]ptrPointer to a memory block to be reallocated.
[in]newSizeNew size of memory block in bytes.
[out]newPtrPointer to a FS_LPVOID object that receives a new reallocated memory block.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter newPtr is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or if invalid memory access.
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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Page_GetDocument ( FSCRT_PAGE  page,
FSCRT_DOCUMENT *  document 
)

Get a document handle related to a page.

Parameters
[in]pageHandle to a FSCRT_PAGE object which is a page object. A page is an element of a document.
[out]documentPointer to a FSCRT_DOCUMENT handle that receives a handle of document object associated with the parameter page.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter document or page 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.
  • page: this handle is long-term partially recoverable.
  • document: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_AddPointsCount ( FSCRT_PATHDATA  pathData,
FS_INT32  count 
)

Add a number of points to the given path data.

This function will reallocate more memory for the given number of points. Call the function FSCRT_PathData_Clear to free memory of all points.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is a path data object.
[in]countCount of new points added to the given path data. It should not be negative.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData is NULL, or the parameter count is invalid.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
After call this function, you shall call the function FSCRT_PathData_SetPoint to set the points you add.
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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_AppendEllipse ( FSCRT_PATHDATA  pathData,
const FSCRT_RECTF rect 
)

Add an ellipse figure to path data.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is a path data object.
[in]rectPointer to a FSCRT_RECTF structure for a enclosing rectangle of an ellipse.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_AppendRect ( FSCRT_PATHDATA  pathData,
const FSCRT_RECTF rect 
)

Add a rectangle figure to path data.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is a path data object.
[in]rectPointer to a FSCRT_RECTF structure for a rectangle.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_Clear ( FSCRT_PATHDATA  pathData)

Clear all points of the given path data.

This function will free all memory allocated for the given path data. Applications can call the function FSCRT_PathData_AddPointsCount to increase memory.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is a path data object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData is NULL.
FSCRT_ERRCODE_ERROR if an 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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_CloseFigure ( FSCRT_PATHDATA  pathData)

Close the last figure of path data.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is a path data object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData is NULL.
FSCRT_ERRCODE_NOTFOUND if path data have no figures.
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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_CountPoints ( FSCRT_PATHDATA  pathData,
FS_INT32 count 
)

Get number of points of the given path data.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is a path data object.
[out]countPointer to a FS_INT32 object that receives point count of the given path data.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData or count 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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_Create ( FSCRT_PATHDATA *  pathData)

Create new path data.

Parameters
[out]pathDataPointer to a FSCRT_PATHDATA handle that receives an object of path data.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_CubicBezierTo ( FSCRT_PATHDATA  pathData,
FS_FLOAT  x1,
FS_FLOAT  y1,
FS_FLOAT  x2,
FS_FLOAT  y2,
FS_FLOAT  x3,
FS_FLOAT  y3 
)

Add Bezier points to a given path data.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is a path data object.
[in]x1The value of the X coordinate of the first control point.
[in]y1The value of the Y coordinate of the first control point.
[in]x2The value of the X coordinate of the second control point.
[in]y2The value of the Y coordinate of the second control point.
[in]x3The value of the X coordinate of the end point.
[in]y3The value of the Y coordinate of the end point.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Points and an ending point in the path constitutes a Bezier curve.
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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_GetPoint ( FSCRT_PATHDATA  pathData,
FS_INT32  index,
FS_FLOAT x,
FS_FLOAT y,
FS_INT32 pointType 
)

Get a specific point of the given path data.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is a path data object.
[in]indexThe index of the point.
[out]xPointer to a FS_FLOAT object that receives the value of the X coordinate of the point.
[out]yPointer to a FS_FLOAT object that receives the value of the Y coordinate of the point.
[out]pointTypePointer to a FS_INT32 object that receives path point types. It would be one of the following macro definitions:
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData, x, y or pointType is NULL.
FSCRT_ERRCODE_NOTFOUND if the parameter index is out of range.
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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_LineTo ( FSCRT_PATHDATA  pathData,
FS_FLOAT  x,
FS_FLOAT  y 
)

Add a point to a given figure, and a line is to be drawn from the current position to this point, which then becomes a new current position.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is a path data object.
[in]xThe value of the X coordinate of the point.
[in]yThe value of the Y coordinate of the point.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_MoveTo ( FSCRT_PATHDATA  pathData,
FS_FLOAT  x,
FS_FLOAT  y 
)

Add a point to start a figure. This point will become a new current position.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is a path data object.
[in]xThe value of the X coordinate of the point.
[in]yThe value of the Y coordinate of the point.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_Release ( FSCRT_PATHDATA  pathData)

Release all related resources of the given path data.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is a path data object.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData is NULL.
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 long-term recoverable.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_RemovePoint ( FSCRT_PATHDATA  pathData,
FS_INT32  index 
)

Remove the specific point of the given path data.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is a path data object.
[in]indexThe index of the given point.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData is NULL.
FSCRT_ERRCODE_NOTFOUND if the parameter index is out of range.
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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_SetPoint ( FSCRT_PATHDATA  pathData,
FS_INT32  index,
FS_FLOAT  x,
FS_FLOAT  y,
FS_INT32  pointType 
)

Set the specific point of the path data.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is the path data object.
[in]indexThe index of the point.
[in]xThe value of the X coordinate of the point.
[in]yThe value of the Y coordinate of the point.
[in]pointTypeThe path point types. It should be one of the following macro definitions:
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData is NULL or the parameter pointType is invalid.
FSCRT_ERRCODE_NOTFOUND if the parameter index is out of range.
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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PathData_Transform ( FSCRT_PATHDATA  pathData,
const FSCRT_MATRIX matrix 
)

Transform all path points into path data with a given matrix.

Parameters
[in]pathDataHandle to a FSCRT_PATHDATA object which is the path data object.
[in]matrixPointer to a FSCRT_MATRIX structure for a coordinate matrix.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter pathData or matrix 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.
  • pathData: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Progress_Continue ( FSCRT_PROGRESS  progress,
FSCRT_PAUSEHANDLER pause 
)

Continue a progressive process.

Parameters
[in]progressHandle to a FSCRT_PROGRESS object which is a progressive object created by the START functions, such as FSPDF_RenderContext_StartPage.
[in]pausePointer to a FSCRT_PAUSEHANDLER structure to determine break state.
If it is NULL or FSCRT_PAUSEHANDLER::NeedPauseNow is NULL, this function will not return until it is finished or an error occurs.
Returns
FSCRT_ERRCODE_FINISHED if the current process is finished successfully.
FSCRT_ERRCODE_TOBECONTINUED if the current process is paused, applications need to call this function again.
FSCRT_ERRCODE_ROLLBACK if applications need to rollback.
FSCRT_ERRCODE_PARAM if the parameter progress is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an memory exception raises.
FSCRT_ERRCODE_ERROR if an error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
A progress is a long-time process object, and it is splited with a FSCRT_PAUSEHANDLER structure.
Foxit PDF SDK contains several different types of progressive processes. For example, the function FSPDF_Page_StartParse parses a PDF page, the function FSPDF_RenderContext_StartPage renders a PDF page, etc. Different progressive processes implement this function in various ways, so it may return different error codes. Please refer to comments in STRART functions.
Attention
Thread Safety: this function is thread safe.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • For parsing page progress:
    • This function is long-term recoverable.
    • progress: this handle is long-term recoverable.
  • For progress of importing page, saving document, rendering page, doing encryption, parsing reflow page, rendering reflow page:
    • This function is long-term unrecoverable.
    • progress: this handle is long-term partially recoverable.
  • For progress of rendering annotation(s), rendering form control(s):
    • This function is short-term.
    • progress: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Progress_GetPercent ( FSCRT_PROGRESS  progress,
FS_INT32 percent 
)

Get a percent of progressive process.

Parameters
[in]progressHandle to a FSCRT_PROGRESS object which is a progressive object created by the START functions, such as the function FSPDF_RenderContext_StartPage.
[out]percentPointer to a FS_INT32 object that receives the current progressive percent.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter progress or position is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if fails to get percent for other reasons.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Different progressive processes implement this function in various ways, so it may return different error codes.
Attention
Thread Safety: this function is thread safe.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • For parsing page progress:
    • This function is long-term recoverable.
    • progress: this handle is long-term recoverable.
  • For progress of parsing reflow page, rendering reflow page:
    • This function is long-term unrecoverable.
    • progress: this handle is long-term partially recoverable.
  • For progress of importing page, saving document, rendering page, doing encryption:
    • This function is short-term.
    • progress: this handle is long-term partially recoverable.
  • For progress of rendering annotation(s), rendering form control(s):
    • This function is short-term.
    • progress: this handle is short-term.
FS_RESULT FSCRT_Progress_Release ( FSCRT_PROGRESS  progress)

Release the current progressive process.

Parameters
[in]progressHandle to a FSCRT_PROGRESS object which is a progressive object created by START functions, such as the function FSPDF_RenderContext_StartPage.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter progress is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Different progressive processes implement this function in various ways, so it may return different error codes.
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.
  • OOM property of progress depends on the actual kind of progress.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Progress_SetProperty ( FSCRT_PROGRESS  progress,
const FSCRT_BSTR property,
const FSCRT_VAR values,
FS_INT32  count 
)

Set property of current progressive process.

Currently, this function only support to set the property of "fileversion", and FSCRT_VAR::type shall be FSCRT_VT_INT32.

Parameters
[in]progressHandle to a FSCRT_PROGRESS object. It shall be valid.
[in]propertyPointer to a FSCRT_BSTR structure or array that specifies the property information of a progress to be set.
[in]valuesPointer to a FSCRT_VAR structure or array that specifies the value of a progress property. It shall match the parameter property.
[in]countThe count of properties to be set.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter progress, property or values is NULL, or value of values or count is invalid.
FSCRT_ERRCODE_UNSUPPORTED if the current progress does not support this function.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_UNSUPPORTED if the parameter property or values or count is not supported.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Different progressive processes are implemented in various way, so it may return different error codes.
Attention
Thread Safety: this function is thread safe.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • For saving document progress:
    • This function is long-term recoverable.
    • progress: this handle is long-term partially recoverable.
  • For other kind of progress: currently, not support this function.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_Rect_IsAdjacent ( const FSCRT_RECTF rect1,
const FSCRT_RECTF rect2,
FS_FLOAT  alignmentTolerance,
FS_FLOAT  distanceTolerance,
FS_DWORD  direction,
FS_BOOL adjacent 
)

Helper function to determine whether one rectangle is adjacent to another in the horizontal or vertical direction.

Parameters
[in]rect1Pointer to a FSCRT_RECTF structure for the first rectangle.
[in]rect2Pointer to a FSCRT_RECTF structure for the second rectangle.
[in]alignmentToleranceAlignment tolerance to be allowed between two rectangles. Measured in coordinate units, and should be non-negative value.
[in]distanceToleranceDistance tolerance to be allowed between two rectangles. Measured in coordinate units, and should be non-negative value.
[in]directionSpecify a direction to judge adjacent state between two rectangles:
  • 0 is horizontal
  • 1 is vertical.
[out]adjacentPointer to a FS_BOOL object that receives the adjacent state. TRUE means the parameter rect1 is adjacent to the parameter rect2, while FALSE means not.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter rect1 or rect2 or adjacent 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.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_UTF8_CountChars ( const FSCRT_BSTR utf8Str,
FS_DWORD count,
FS_DWORD pos 
)

Get count of characters stored in a UTF-8 string.

Parameters
[in]utf8StrPointer to a UTF-8 encoded string, it should be a valid pointer to FSCRT_BSTR.
[out]countPointer to a FS_DWORD object that receives count of characters in parameter utf8Str. It should not be a NULL pointer.
[out]posPointer to a FS_DWORD object that receives index position of FSCRT_BSTR::str, in bytes, indicating wrong byte position which is incompatible with UTF-8 format the in parameter utf8Str.
It is limited by the value of FSCRT_BSTR::len in the parameter utf8Str. Pass NULL to this parameter to ignore it.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter utf8Str or count is NULL.
FSCRT_ERRCODE_FORMAT if it is not a UTF-8 byte string in the parameter utf8Str.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
UTF-8 is a standard character encoding method defined by Unicode Consortium.
This function retrieves the real number of unicode characters stored in the parameter utf8Str.
If it contains any wrong bytes, the parameter pos is used to get an index and returns FSCRT_ERRCODE_FORMAT.
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 FSCRT_UTF8_FromUTF16BE ( FSCRT_BSTR utf8Str,
const FS_WORD buffer,
FS_DWORD  length 
)

Convert a UTF-16BE string into a UTF-8 string.

Parameters
[out]utf8StrPointer to a valid FSCRT_BSTR structure that receives a UTF-8 encoded string.
[in]bufferPointer to a buffer which stores a valid UTF-16BE string, it shall not be NULL.
[in]lengthLength of UTF-16BE string in words (double bytes) stored in the parameter buffer.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter utf8Str or buffer is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
UTF-8 is a standard character encoding format defined by Unicode Consortium.
UTF-16BE is a big-endian 16-bit Unicode format defined by Unicode Consortium.
This function will call the function FSCRT_Memory_Alloc or FSCRT_Memory_Realloc to allocate or reallocate memory to store UTF-8 string data in the parameter utf8Str.
It is necessary for applications to prepare buffer before calling this function.
Attention
Thread Safety: this function is not thread safe. It may cause unexpected errors when the same object is handled by multiple threads. Applications shall maintain thread safety in this scenario.
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 FSCRT_UTF8_FromUTF16LE ( FSCRT_BSTR utf8Str,
const FS_WORD buffer,
FS_DWORD  length 
)

Encode a UTF-16LE string into a UTF-8 string.

Parameters
[out]utf8StrPointer to a valid FSCRT_BSTR structure that receives a UTF-8 encoded string.
[in]bufferPointer to a buffer which stores valid UTF-16LE string, it shall not be NULL.
[in]lengthLength of UTF-16LE string in words (double bytes) stored in parameter buffer.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if parameter utf8Str or buffer is a NULL pointer.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
UTF-8 is a standard character encoding method defined by Unicode Consortium.
UTF-16LE is a little-endian 16-bit Unicode format defined by Unicode Consortium.
This function will call the function FSCRT_Memory_Alloc or FSCRT_Memory_Realloc to allocate or reallocate memory to store UTF-8 string data in the parameter utf8Str.
It is necessary for applications to prepare buffer before calling this function.
Attention
Thread Safety: this function is not thread safe. It may cause unexpected errors when the same object is handled by multiple threads. Applications shall maintain thread safety in this scenario.
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 FSCRT_UTF8_FromUTF32BE ( FSCRT_BSTR utf8Str,
const FS_DWORD buffer,
FS_DWORD  length 
)

Convert a UTF-32BE string into a UTF-8 string.

Parameters
[out]utf8StrPointer to a valid FSCRT_BSTR structure that receives a UTF-8 encoded string.
[in]bufferPointer to a buffer which stores a valid UTF-32BE string, it cannot be NULL.
[in]lengthLength of UTF-32BE string in words (double bytes) is stored in the parameter buffer.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter utf8Str or buffer is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
UTF-8 is a standard character encoding method defined by Unicode Consortium.
UTF-32BE is a big-endian 32-bit Unicode format defined by Unicode Consortium.
This function will call the function FSCRT_Memory_Alloc or FSCRT_Memory_Realloc to allocate or reallocate memory to store UTF-8 string data in the parameter utf8Str.
It is necessary for applications to prepare buffer before calling this function.
Attention
Thread Safety: this function is not thread safe. It may cause unexpected errors when the same object is handled by multiple threads. Applications shall maintain thread safety in this scenario.
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 FSCRT_UTF8_FromUTF32LE ( FSCRT_BSTR utf8Str,
const FS_DWORD buffer,
FS_DWORD  length 
)

Convert a UTF-32LE string into a UTF-8 string.

Parameters
[out]utf8StrPointer to a valid FSCRT_BSTR structure that receives a UTF-8 encoded string.
[in]bufferPointer to a buffer which stores a valid UTF-32LE string, it shall not be NULL.
[in]lengthLength of UTF-32LE string in double words (4 bytes) stored in the parameter buffer.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter utf8Str or buffer is NULL.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
UTF-8 is a standard character encoding format defined by Unicode Consortium.
UTF-32LE is a little-endian 32-bit Unicode format defined by Unicode Consortium.
This function will call the function FSCRT_Memory_Alloc or FSCRT_Memory_Realloc to allocate or reallocate memory to store UTF-8 string data in the parameter utf8Str.
It is necessary for applications to prepare buffer before calling this function.
Attention
Thread Safety: this function is not thread safe. It may cause unexpected errors when the same object is handled by multiple threads. Applications shall maintain thread safety in this scenario.
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 FSCRT_UTF8_ToUTF16BE ( const FSCRT_BSTR utf8Str,
FS_WORD buffer,
FS_DWORD length 
)

Convert a UTF-8 string to a UTF-16BE string.

Parameters
[in]utf8StrPointer to a UTF-8 encoded string, it should be a valid pointer to FSCRT_BSTR.
[out]bufferPointer to a buffer to receive UTF-16BE string. It can be NULL when there is not UTF-16BE string data.
[in,out]lengthPointer to a FS_DWORD object receives the length of buffer.
When this function is called, it should be the size of parameter the buffer in words (double bytes).
When this function returns, it contains the real number of UTF-16BE characters stored in the parameter buffer.
This parameter cannot be NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter utf8Str or length is NULL.
FSCRT_ERRCODE_FORMAT if it is not a UTF-8 byte string in the parameter utf8Str.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
UTF-8 is a standard character encoding format defined by Unicode Consortium.
UTF-16BE is a big-endian 16-bit Unicode format defined by Unicode Consortium.
Usually, this function is called twice, pass NULL to the parameter buffer first to retrieve buffer size,
and call it again when the parameter buffer got from the first calling. The parameter length shall not be empty.
Return FSCRT_ERRCODE_FORMAT if there are incorrect byte formats.
Applications can call the function FSCRT_UTF8_CountChars to check if there are incorrect bytes.
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 FSCRT_UTF8_ToUTF16LE ( const FSCRT_BSTR utf8Str,
FS_WORD buffer,
FS_DWORD length 
)

Convert a UTF-8 string to a UTF-16LE string.

Parameters
[in]utf8StrPointer to a UTF-8 encoded string, it should be a valid pointer to FSCRT_BSTR.
[out]bufferPointer to a buffer to receive a UTF-16LE string. It can be NULL when there is not UTF-16LE string data.
[in,out]lengthPointer to a FS_DWORD object receives the length of the given buffer.
When this function is called, it should be the size of parameter buffer in words (double bytes).
When this function returns, it contains the real number of UTF-16LE characters stored in the parameter buffer.
This parameter shall not be NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter utf8Str or length is NULL.
FSCRT_ERRCODE_FORMAT if it is not a UTF-8 byte string in the parameter utf8Str.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
UTF-8 is a standard character encoding method defined by Unicode Consortium.
UTF-16LE is a little-endian 16-bit Unicode format defined by Unicode Consortium.
Usually, this function is called twice: pass NULL to the parameter buffer first to retrieve buffer size, and call it again when the parameter buffer got from the first calling. The parameter length shall not be empty.
Return FSCRT_ERRCODE_FORMAT when it contains any incorrect bytes.
Applications can call the function FSCRT_UTF8_CountChars to check if there are any incorrect bytes.
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 FSCRT_UTF8_ToUTF32BE ( const FSCRT_BSTR utf8Str,
FS_DWORD buffer,
FS_DWORD length 
)

Convert a UTF-8 string to a UTF-32BE string.

Parameters
[in]utf8StrPointer to a UTF-8 encoded string, it shall be a valid pointer to FSCRT_BSTR.
[out]bufferPointer to a buffer to receive UTF-32BE string. It can be NULL when there are not UTF-32BE string data.
[in,out]lengthPointer to a FS_DWORD object receives the length of buffer.
When this function is called, it shall be the size of the parameter buffer in double words.
When this function returns, it contains the real number of UTF-32BE characters stored in the parameter buffer.
This parameter shall not be NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter utf8Str or length is NULL.
FSCRT_ERRCODE_FORMAT if it is not a UTF-8 byte string in the parameter utf8Str.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
UTF-8 is a standard character encoding format defined by Unicode Consortium.
UTF-32BE is a big-endian 32-bit Unicode format defined by Unicode Consortium.
Usually, this function is called twice, pass NULL to the parameter buffer first to retrieve buffer size,
and call it again when the parameter buffer got from the first calling. The parameter length shall not be empty.
Return FSCRT_ERRCODE_FORMAT if there are any incorrect bytes.
Applications can call the function FSCRT_UTF8_CountChars to check if there are incorrect bytes.
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 FSCRT_UTF8_ToUTF32LE ( const FSCRT_BSTR utf8Str,
FS_DWORD buffer,
FS_DWORD length 
)

Convert a UTF-8 string to a UTF-32LE string.

Parameters
[in]utf8StrPointer to a UTF-8 encoded string, it should be a valid pointer to FSCRT_BSTR.
[out]bufferPointer to a buffer to receive UTF-32LE string. It can be NULL when there are not UTF-32LE string data.
[in,out]lengthPointer to a FS_DWORD object receives the length of buffer.
When this function is called, it should be the size of the parameter buffer in double words.
When this function returns, it contains the real number of UTF-32LE characters stored in the parameter buffer.
This parameter cannot be NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter utf8Str or length is NULL.
FSCRT_ERRCODE_FORMAT if it is not a UTF-8 byte string in the parameter utf8Str.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
UTF-8 is a standard character encoding format defined by Unicode Consortium.
UTF-32LE is a little-endian 32-bit Unicode format defined by Unicode Consortium.
Usually, this function is called twice, pass NULL to the parameter buffer to retrieve buffer size,
and call it again when the parameter buffer got from the first calling. The parameter length shall not be empty.
Return FSCRT_ERRCODE_FORMAT when there are incorrect bytes.
Applications can call the function FSCRT_UTF8_CountChars to check if there are incorrect bytes.
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.

Foxit Corporation