Foxit Embedded PDF SDK
|
Data Structures | |
struct | FPDFEMB_MEMMGR |
Structure: FPDFEMB_MEMMGR Including interfaces implemented by host application, providing memory allocation facilities. All members are required. A memory manager structure is required to be valid during the entire period when an application using FPDFEMB module. More... | |
struct | FPDFEMB_MEMMGR2 |
Structure: FPDFEMB_MEMMGR2 Interfaces for extensible fixed memory manager. This kind of memory manager starts with a fixed memory pool but when it runs out, the manager will call out and ask for more memory. More... | |
struct | FPDFEMB_MEMMGR_EX |
Structure: FPDFEMB_MEMMGR_EX This is an extended version of memory manager interface, allowing advanced memory management, including movable and discardable memory blocks. More... | |
struct | FPDFEMB_FILE_ACCESS |
Structure: FPDFEMB_FILE_ACCESS Describe the way to access a file (readonly). More... | |
struct | FPDFEMB_PAUSE |
Structure: FPDFEMB_PAUSE An interface for pausing a progressive process. More... | |
struct | FPDFEMB_RECT |
Structure: FPDFEMB_RECT Rectangle area in device or page coordination system. More... | |
struct | FPDFEMB_POINT |
Structure: FPDFEMB_POINT A point in device or page coordination system. More... | |
struct | FPDFEMB_CHAR_INFO |
Structure: FPDFEMB_CHAR_INFO Character information. More... | |
struct | FPDFEMB_FONT_MAPPER |
Structure: FPDFEMB_FONT_MAPPER Defines interface for system font mapper. More... | |
struct | FPDFEMB_GLYPH_PROVIDER |
Structure: FPDFEMB_GLYPH_PROVIDER Interface for providing glyph bitmap of non-latin characters. This is usually used for embedded devices with Chinese/Japanese/Korean fonts installed, but those fonts are not in TrueType or Type1 format. More... | |
struct | FPDFEMB_PAGEDEST |
Data structure for page destination. More... | |
struct | FPDFEMB_DOCDEST |
Data structure for document destination. More... | |
struct | FPDFEMB_URLDEST |
Data structure for URL destination. More... | |
struct | FPDFEMB_LAUNCHACTION |
Data structure for Launch action. More... | |
struct | FPDFEMB_TEXTMATRIX |
Text matrix for FPDFEMB. More... | |
Files | |
file | fpdfemb.h |
Header file for FPDFEMB SDK. | |
Typedefs | |
typedef int | FPDFEMB_RESULT |
Standard return type for many FPDFEMB functions: FPDFERR_SUCCESS for success, otherwise error code. | |
typedef int | FPDFEMB_BOOL |
Standard boolean type: 0 for false, non-zero for true. | |
typedef unsigned short | FPDFEMB_WCHAR |
Unicode character. FPDFEMB uses UTF16LE format for unicode string. | |
typedef void(* | FPDFEMB_FIXED_OOM_HANDLER )(void *memory, int size) |
Fixed memory OOM(out-of-memory) handler type. | |
typedef void * | FPDFEMB_DOCUMENT |
PDF document handle type. | |
typedef void * | FPDFEMB_PAGE |
PDF page handle type. | |
typedef void * | FPDFEMB_BITMAP |
Bitmap handle type. | |
typedef void * | FPDFEMB_ACTION |
PDF action handle type. | |
typedef void * | FPDFEMB_BOOKMARK |
PDF bookmark handle type. | |
typedef void * | FPDFEMB_FONT |
PDF font handle type. | |
Functions | |
FPDFEMB_RESULT | FPDFEMB_Init (struct FPDFEMB_MEMMGR *mem_mgr) |
Function: FPDFEMB_Init Initialize the FPDFEMB module. | |
FPDFEMB_RESULT | FPDFEMB_InitFixedMemory (void *memory, int size, FPDFEMB_FIXED_OOM_HANDLER oom_handler) |
Function: FPDFEMB_InitFixedMemory Initialize the FPDFEMB module, providing a fixed memory heap. | |
FPDFEMB_RESULT | FPDFEMB_InitFixedMemory2 (void *memory, int size, struct FPDFEMB_MEMMGR2 *callbacks, FPDFEMB_FIXED_OOM_HANDLER oom_handler) |
Function: FPDFEMB_InitFixedMemory2 Initialize FPDFEMB using an extensible fixed memory manager. With this kind of manager, when current memory pool runs out, the application may provide some additional memory block for the manager to use. | |
FPDFEMB_RESULT | FPDFEMB_InitEx (struct FPDFEMB_MEMMGR_EX *mem_mgr) |
Function: FPDFEMB_InitEx Initialize the FPDFEMB module with the extended memory manager Comments: This function will allocate necessary internal data structure for the whole module to operate. | |
void | FPDFEMB_Exit () |
Function: FPDFEMB_Exit Stop using FPDFEMB module and release all resources Comments: All loaded documents and pages will become invalid after this call. | |
void * | FPDFEMB_AllocMemory (unsigned int size) |
void | FPDFEMB_FreeMemory (void *pointer) |
void | FPDFEMB_FreeCaches () |
FPDFEMB_RESULT | FPDFEMB_StartLoadDocument (struct FPDFEMB_FILE_ACCESS *file, const char *password, FPDFEMB_DOCUMENT *document, struct FPDFEMB_PAUSE *pause) |
FPDFEMB_RESULT | FPDFEMB_ContinueLoadDocument (FPDFEMB_DOCUMENT document, struct FPDFEMB_PAUSE *pause) |
Function: FPDFEMB_ContinueLoadDocument Continue loading a PDF document. | |
FPDFEMB_RESULT | FPDFEMB_CloseDocument (FPDFEMB_DOCUMENT document) |
int | FPDFEMB_GetPageCount (FPDFEMB_DOCUMENT document) |
void | FPDFEMB_SetFileBufferSize (int size) |
FPDFEMB_RESULT | FPDFEMB_LoadPage (FPDFEMB_DOCUMENT document, int index, FPDFEMB_PAGE *page) |
FPDFEMB_RESULT | FPDFEMB_ClosePage (FPDFEMB_PAGE page) |
FPDFEMB_RESULT | FPDFEMB_GetPageSize (FPDFEMB_PAGE page, int *width, int *height) |
FPDFEMB_RESULT | FPDFEMB_GetPageBBox (FPDFEMB_PAGE page, struct FPDFEMB_RECT *rect) |
FPDFEMB_RESULT | FPDFEMB_StartParse (FPDFEMB_PAGE page, FPDFEMB_BOOL text_only, struct FPDFEMB_PAUSE *pause) |
FPDFEMB_RESULT | FPDFEMB_ContinueParse (FPDFEMB_PAGE page, struct FPDFEMB_PAUSE *pause) |
int | FPDFEMB_GetParseProgress (FPDFEMB_PAGE page) |
FPDFEMB_RESULT | FPDFEMB_StartQuickDraw (FPDFEMB_BITMAP dib, FPDFEMB_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int flags, struct FPDFEMB_PAUSE *pause) |
FPDFEMB_RESULT | FPDFEMB_ContinueQuickDraw (FPDFEMB_PAGE page, struct FPDFEMB_PAUSE *pause) |
FPDFEMB_RESULT | FPDFEMB_StartRender (FPDFEMB_BITMAP dib, FPDFEMB_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int flags, struct FPDFEMB_RECT *clip, struct FPDFEMB_PAUSE *pause) |
FPDFEMB_RESULT | FPDFEMB_ContinueRender (FPDFEMB_PAGE page, struct FPDFEMB_PAUSE *pause) |
int | FPDFEMB_GetRenderProgress (FPDFEMB_PAGE page) |
void | FPDFEMB_SetHalftoneLimit (int limit) |
void | FPDFEMB_DeviceToPagePoint (FPDFEMB_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, struct FPDFEMB_POINT *point) |
void | FPDFEMB_DeviceToPageRect (FPDFEMB_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, struct FPDFEMB_RECT *rect) |
void | FPDFEMB_PageToDevicePoint (FPDFEMB_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, struct FPDFEMB_POINT *point) |
void | FPDFEMB_PageToDeviceRect (FPDFEMB_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, struct FPDFEMB_RECT *rect) |
FPDFEMB_RESULT | FPDFEMB_FindFirst (FPDFEMB_PAGE page, const FPDFEMB_WCHAR *pattern, FPDFEMB_BOOL from_last, unsigned int flags) |
FPDFEMB_RESULT | FPDFEMB_FindFrom (FPDFEMB_PAGE page, const FPDFEMB_WCHAR *pattern, int pos, unsigned int flags) |
FPDFEMB_RESULT | FPDFEMB_FindNext (FPDFEMB_PAGE page) |
FPDFEMB_RESULT | FPDFEMB_FindPrev (FPDFEMB_PAGE page) |
int | FPDFEMB_CountFoundRects (FPDFEMB_PAGE page) |
FPDFEMB_RESULT | FPDFEMB_GetFoundRect (FPDFEMB_PAGE page, int index, struct FPDFEMB_RECT *rect) |
int | FPDFEMB_GetSearchPos (FPDFEMB_PAGE page) |
FPDFEMB_RESULT | FPDFEMB_QuickSearch (FPDFEMB_DOCUMENT document, int page_index, const FPDFEMB_WCHAR *pattern, int case_sensitive) |
FPDFEMB_RESULT | FPDFEMB_GetCharCount (FPDFEMB_PAGE page, int *count) |
FPDFEMB_RESULT | FPDFEMB_GetCharInfo (FPDFEMB_PAGE page, int index, struct FPDFEMB_CHAR_INFO *char_info) |
FPDFEMB_RESULT | FPDFEMB_GetCharIndexAtPos (FPDFEMB_PAGE page, double x, double y, int *index) |
FPDFEMB_RESULT | FPDFEMB_CreateDIB (int width, int height, int format, void *buffer, int stride, FPDFEMB_BITMAP *dib) |
FPDFEMB_RESULT | FPDFEMB_DestroyDIB (FPDFEMB_BITMAP dib) |
int | FPDFEMB_GetDIBWidth (FPDFEMB_BITMAP dib) |
int | FPDFEMB_GetDIBHeight (FPDFEMB_BITMAP dib) |
void * | FPDFEMB_GetDIBData (FPDFEMB_BITMAP dib) |
int | FPDFEMB_GetDIBStride (FPDFEMB_BITMAP dib) |
FPDFEMB_RESULT | FPDFEMB_GetRotatedDIB (FPDFEMB_BITMAP dib, FPDFEMB_BOOL bFlipX, FPDFEMB_BOOL bFlipY, FPDFEMB_BITMAP *result_dib) |
FPDFEMB_RESULT | FPDFEMB_StretchDIB (FPDFEMB_BITMAP dest_dib, int dest_left, int dest_top, int dest_width, int dest_height, struct FPDFEMB_RECT *clip_rect, FPDFEMB_BITMAP src_dib, FPDFEMB_BOOL interpol) |
FPDFEMB_RESULT | FPDFEMB_TransformDIB (FPDFEMB_BITMAP dest_dib, struct FPDFEMB_RECT *clip_rect, FPDFEMB_BITMAP src_dib, int x, int y, int xx, int yx, int xy, int yy, FPDFEMB_BOOL interpol) |
FPDFEMB_RESULT | FPDFEMB_SetFontMapper (struct FPDFEMB_FONT_MAPPER *mapper) |
void | FPDFEMB_SetGlyphProvider (struct FPDFEMB_GLYPH_PROVIDER *provider) |
void | FPDFEMB_UseExternalData (const unsigned char *data, unsigned int size) |
void | FPDFEMB_LoadCMap_GB () |
void | FPDFEMB_LoadCMap_GB_Ext () |
void | FPDFEMB_LoadCMap_CNS () |
void | FPDFEMB_LoadCMap_Korea () |
void | FPDFEMB_LoadCMap_Japan () |
void | FPDFEMB_LoadCMap_Japan_Ext () |
FPDFEMB_RESULT | FPDFEMB_GetDocInfoString (FPDFEMB_DOCUMENT document, const char *key, void *buffer, unsigned int *bufsize) |
FPDFEMB_RESULT | FPDFEMB_Action_GetType (FPDFEMB_DOCUMENT document, FPDFEMB_ACTION action, int *dest_type, int *data_size) |
FPDFEMB_RESULT | FPDFEMB_Action_GetData (FPDFEMB_DOCUMENT document, FPDFEMB_ACTION action, void *buffer) |
FPDFEMB_RESULT | FPDFEMB_Action_GetNext (FPDFEMB_ACTION action, FPDFEMB_ACTION *next) |
FPDFEMB_RESULT | FPDFEMB_Bookmark_GetFirstChild (FPDFEMB_DOCUMENT document, FPDFEMB_BOOKMARK parent, FPDFEMB_BOOKMARK *bookmark) |
FPDFEMB_RESULT | FPDFEMB_Bookmark_GetNextSibling (FPDFEMB_DOCUMENT document, FPDFEMB_BOOKMARK bookmark, FPDFEMB_BOOKMARK *sibling) |
FPDFEMB_RESULT | FPDFEMB_Bookmark_GetTitle (FPDFEMB_BOOKMARK bookmark, void *buffer, unsigned int *bufsize) |
FPDFEMB_RESULT | FPDFEMB_Bookmark_GetPage (FPDFEMB_DOCUMENT document, FPDFEMB_BOOKMARK bookmark, int *page) |
FPDFEMB_RESULT | FPDFEMB_Bookmark_GetAction (FPDFEMB_DOCUMENT document, FPDFEMB_BOOKMARK bookmark, FPDFEMB_ACTION *action) |
FPDFEMB_RESULT | FPDFEMB_Link_GetCount (FPDFEMB_PAGE page, int *link_count, int reserved) |
FPDFEMB_RESULT | FPDFEMB_Link_GetAction (FPDFEMB_PAGE page, int link_index, FPDFEMB_ACTION *action) |
FPDFEMB_RESULT | FPDFEMB_Link_GetAreaCount (FPDFEMB_PAGE page, int link_index, int *count) |
FPDFEMB_RESULT | FPDFEMB_Link_GetArea (FPDFEMB_PAGE page, int link_index, int area_index, struct FPDFEMB_POINT *points) |
FPDFEMB_RESULT | FPDFEMB_OpenStandardFont (int font_id, FPDFEMB_FONT *font_handle) |
FPDFEMB_RESULT | FPDFEMB_OpenFileFont (struct FPDFEMB_FILE_ACCESS *file, FPDFEMB_FONT *font_handle) |
FPDFEMB_RESULT | FPDFEMB_CloseFont (FPDFEMB_FONT font_handle) |
FPDFEMB_RESULT | FPDFEMB_GetGlyphIndex (FPDFEMB_FONT font_handle, int encoding, unsigned long char_code, unsigned long *glyph_index) |
FPDFEMB_RESULT | FPDFEMB_GetGlyphWidth (FPDFEMB_FONT font_handle, unsigned long glyph_index, unsigned long *width) |
FPDFEMB_RESULT | FPDFEMB_OutputGlyph (FPDFEMB_BITMAP dib, int x, int y, FPDFEMB_FONT font_handle, double font_size, struct FPDFEMB_TEXTMATRIX *matrix, unsigned long glyph_index, unsigned long argb) |
FPDFEMB_RESULT | FPDFEMB_OutputText (FPDFEMB_BITMAP dib, int x, int y, FPDFEMB_FONT font_handle, double font_size, struct FPDFEMB_TEXTMATRIX *matrix, const FPDFEMB_WCHAR *text, unsigned long argb) |
void | FPDFEMB_SetLogProc (void(*proc)(const char *msg)) |
FPDFEMB_RESULT | FPDFEMB_GetContentMargin (FPDFEMB_PAGE page, int *left, int *top, int *right, int *bottom, unsigned long backcolor) |
FPDFEMB_RESULT | FPDFEMB_GetPageLabel (FPDFEMB_DOCUMENT document, int nPage, void *buffer, unsigned int *bufsize) |
FPDFEMB_RESULT | FPDFEMB_PageLabelToPageNum (FPDFEMB_DOCUMENT document, FPDFEMB_WCHAR *pagelabel, int *pageNum) |
Error codes for FPDFEMB SDK | |
#define | FPDFERR_SUCCESS 0 |
Success. | |
#define | FPDFERR_MEMORY 1 |
Out of memory. | |
#define | FPDFERR_ERROR 2 |
Error of any kind, without specific reason. | |
#define | FPDFERR_PASSWORD 3 |
Incorrect password. | |
#define | FPDFERR_FORMAT 4 |
File or data format error. | |
#define | FPDFERR_FILE 5 |
File access error. | |
#define | FPDFERR_PARAM 6 |
Parameter error. | |
#define | FPDFERR_STATUS 7 |
Not in correct status. | |
#define | FPDFERR_TOBECONTINUED 8 |
To be continued. | |
#define | FPDFERR_NOTFOUND 9 |
Search result not found. | |
Memory Management Flags | |
#define | FPDFEMB_NONLEAVE 1 |
Non-leave. | |
#define | FPDFEMB_MOVABLE 2 |
Movable. | |
#define | FPDFEMB_DISCARDABLE 4 |
Discardable. | |
Enable JBIG2 or JPEG2000 image decoder. | |
Comments: If you want to display JBIG2 or JPEG2000 encoded images, you need to call these functions after FPDFEMB initialized.Calling these functions will increase code size by about 200K-400K bytes. Also JPEG2000 decoder may not be available on some platforms. | |
void | FPDFEMB_LoadJbig2Decoder () |
void | FPDFEMB_LoadJpeg2000Decoder () |
Render flags. | |
#define | FPDFEMB_ANNOT 0x01 |
Set if annotations are to be rendered. | |
#define | FPDFEMB_LCD_TEXT 0x02 |
Set if using text rendering optimized for LCD display. | |
#define | FPDFEMB_BGR_STRIPE 0x04 |
Set if the device is using BGR LCD stripe. | |
Search flags for FPDFEMB_FindFirst function. | |
#define | FPDFEMB_MATCHCASE 1 |
whether matching case. | |
#define | FPDFEMB_MATCHWHOLEWORD 2 |
whether matching whole word. | |
#define | FPDFEMB_CONSECUTIVE 4 |
DIB format. | |
#define | FPDFDIB_BGR 1 |
3 bytes per pixel, byte order: Blue, Green, Red. | |
#define | FPDFDIB_BGRx 2 |
4 bytes per pixel, byte order: Blue, Green, Red, not used. | |
#define | FPDFDIB_BGRA 3 |
4 bytes per pixel, byte order: Blue, Green, Red, Alpha. | |
#define | FPDFDIB_GRAY 4 |
1 byte per pixel (grayscale). | |
Charset defines. | |
#define | FPDFEMB_CHARSET_DEFAULT 0 |
Default. | |
#define | FPDFEMB_CHARSET_GB 936 |
For simplified Chinese. | |
#define | FPDFEMB_CHARSET_BIG5 950 |
For traditional Chinese. | |
#define | FPDFEMB_CHARSET_JIS 932 |
For Japanese. | |
#define | FPDFEMB_CHARSET_KOREA 949 |
For Korea. | |
#define | FPDFEMB_CHARSET_UNICODE 1200 |
Unicode. | |
Font flags. | |
#define | FPDFEMB_FONT_FIXEDPITCH 1 |
Fixed pitch. | |
#define | FPDFEMB_FONT_SERIF 2 |
Serif. | |
#define | FPDFEMB_FONT_SYMBOLIC 4 |
Symbolic. | |
#define | FPDFEMB_FONT_SCRIPT 8 |
Script. | |
#define | FPDFEMB_FONT_NONSYMBOLIC 32 |
Non-symbolic. | |
#define | FPDFEMB_FONT_ITALIC 64 |
Italic. | |
#define | FPDFEMB_FONT_ALLCAP 0x10000 |
All cap. | |
#define | FPDFEMB_FONT_SMALLCAP 0x20000 |
Small cap. | |
#define | FPDFEMB_FONT_FORCEBOLD 0x40000 |
Force bold. | |
Action types supported by FPDFEMB | |
#define | FPDFEMB_DEST_NONE 0 |
No or unsupported destination. | |
#define | FPDFEMB_DEST_PAGE 1 |
A page inside the same document. | |
#define | FPDFEMB_DEST_DOC 2 |
An external PDF document. | |
#define | FPDFEMB_DEST_URL 3 |
An external URL. | |
#define | FPDFEMB_ACTION_LAUNCH 4 |
Launch an external file or command. | |
Zoom mode for destination. | |
#define | FPDFEMB_ZOOM_NONE 0 |
Zoom mode not specified. | |
#define | FPDFEMB_ZOOM_FACTOR 1 |
Specific zoom factor is used. | |
#define | FPDFEMB_ZOOM_FITPAGE 2 |
Fit the whole page on screen. | |
#define | FPDFEMB_ZOOM_FITWIDTH 3 |
Fit width of the page on screen. | |
#define | FPDFEMB_ZOOM_FITHEIGHT 4 |
Fit height of the page on screen. | |
#define | FPDFEMB_ZOOM_FITRECT 5 |
Fit a particular rectangle on screen. | |
#define | FPDFEMB_ZOOM_FITCONTENT 6 |
Fit whole content of page on screen. | |
#define | FPDFEMB_ZOOM_FITCONTENTW 7 |
Fit content width of page on screen. | |
#define | FPDFEMB_ZOOM_FITCONTENTH 8 |
Fit content height of page on screen. | |
Standard font ID | |
#define | FPDFEMB_FONT_COURIER 0 |
Courier. | |
#define | FPDFEMB_FONT_COURIER_B 1 |
bold. Courier-Bold. | |
#define | FPDFEMB_FONT_COURIER_BI 2 |
bold italic. Courier-BoldOblique. | |
#define | FPDFEMB_FONT_COURIER_I 3 |
italic. Courier-Oblique. | |
#define | FPDFEMB_FONT_HELVETICA 4 |
Helvetica. | |
#define | FPDFEMB_FONT_HELVETICA_B 5 |
bold. Helvetica-Bold. | |
#define | FPDFEMB_FONT_HELVETICA_BI 6 |
bold italic. Helvetica-BoldOblique. | |
#define | FPDFEMB_FONT_HELVETICA_I 7 |
italic. Helvetica-Oblique. | |
#define | FPDFEMB_FONT_TIMES 8 |
Times-Roman. | |
#define | FPDFEMB_FONT_TIMES_B 9 |
bold. Times-Bold. | |
#define | FPDFEMB_FONT_TIMES_BI 10 |
bold italic. Times-BoldItalic. | |
#define | FPDFEMB_FONT_TIMES_I 11 |
italic. Times-Italic. | |
#define | FPDFEMB_FONT_SYMBOL 12 |
Symbol. | |
#define | FPDFEMB_FONT_ZAPF_DINGBATS 13 |
ZapfDingbats. | |
Font encodings | |
#define | FPDFEMB_ENCODING_INTERNAL 0 |
Whatever internal encoding in the font. | |
#define | FPDFEMB_ENCODING_UNICODE 1 |
Unicode encoding. |
#define FPDFEMB_CONSECUTIVE 4 |
whether matching consecutively (for example, "CC" will match twice in "CCC").
FPDFEMB_RESULT FPDFEMB_Action_GetData | ( | FPDFEMB_DOCUMENT | document, |
FPDFEMB_ACTION | action, | ||
void * | buffer | ||
) |
Function: FPDFEMB_Action_GetData Get detailed data of a particular action Comments: See data structure definition for different action type above. Please note the actual action data might use more space than the structure definition shows, to store things like file name or URL. So you should always call FPDFEMB_Action_GetType first to get data size then allocate enough buffer for this call.
[in] | document | Handle to the document |
[in] | action | Handle to the action |
[out] | buffer | Application allocated buffer receiving the destination data |
FPDFEMB_RESULT FPDFEMB_Action_GetNext | ( | FPDFEMB_ACTION | action, |
FPDFEMB_ACTION * | next | ||
) |
Function: FPDFEMB_Action_GetNext Get next action in an action chain
Comments: If there is no next action, the "next" parameter will be set to NULL after the function returns.
[in] | action | Handle to current action |
[out] | next | Receiving handle to next action. |
FPDFEMB_RESULT FPDFEMB_Action_GetType | ( | FPDFEMB_DOCUMENT | document, |
FPDFEMB_ACTION | action, | ||
int * | dest_type, | ||
int * | data_size | ||
) |
Function: FPDFEMB_Action_GetType Get type of an action
Comments: Each different type of destination has different data structure. The "data_size" result indicates how many bytes is required to hold the destination data structure. The application can then allocate sufficient buffer and then call FPDFEMB_Bookmark_GetDest function to get the real data.
[in] | document | Handle to the document |
[in] | action | Handle to the action |
[out] | dest_type | Pointer to an integer receiving type of the destination. See the above FPDFEMB_DEST_xxx definitions |
[out] | data_size | Pointer to an integer receiving data block size for the destination. If this parameter is NULL, then data size won't be retrieved. |
void* FPDFEMB_AllocMemory | ( | unsigned int | size | ) |
Function: FPDFEMB_AllocMemory Allocate memory
[in] | size | Number of bytes |
FPDFEMB_RESULT FPDFEMB_Bookmark_GetAction | ( | FPDFEMB_DOCUMENT | document, |
FPDFEMB_BOOKMARK | bookmark, | ||
FPDFEMB_ACTION * | action | ||
) |
Function: FPDFEMB_Bookmark_GetAction Get action(s) associated with a particular bookmark
[in] | document | Handle to the document |
[in] | bookmark | Handle to the bookmark |
[out] | action | Receiving handle of first action |
FPDFEMB_RESULT FPDFEMB_Bookmark_GetFirstChild | ( | FPDFEMB_DOCUMENT | document, |
FPDFEMB_BOOKMARK | parent, | ||
FPDFEMB_BOOKMARK * | bookmark | ||
) |
Function: FPDFEMB_Bookmark_GetFirstChild Get first child of a bookmark item, or first top level bookmark item
[in] | document | Handle to the document |
[in] | parent | Handle to the parent bookmark. Can be NULL if you want to get the first top level item. |
[out] | bookmark | Receiving handle to the first child or top level bookmark item. If result is NULL, then bookmark not found. |
FPDFEMB_RESULT FPDFEMB_Bookmark_GetNextSibling | ( | FPDFEMB_DOCUMENT | document, |
FPDFEMB_BOOKMARK | bookmark, | ||
FPDFEMB_BOOKMARK * | sibling | ||
) |
Function: FPDFEMB_Bookmark_GetNextSibling Get next sibling of a bookmark item
[in] | document | Handle to the document |
[in] | bookmark | Handle to the bookmark |
[out] | sibling | Receiving the handle of next sibling. If result is NULL, then this is the last bookmark in this level. |
FPDFEMB_RESULT FPDFEMB_Bookmark_GetPage | ( | FPDFEMB_DOCUMENT | document, |
FPDFEMB_BOOKMARK | bookmark, | ||
int * | page | ||
) |
Function: FPDFEMB_Bookmark_GetPage Get page number of a bookmark pointing to
Comments: Some bookmark might not point to a page, some bookmark might have more than one destination (action), for detailed information about a bookmark, you should call FPDFEMB_Bookmark_GetAction.
[in] | document | Handle to the document |
[in] | bookmark | Handle to the bookmark |
[out] | page | Receiving the page number. -1 if this bookmark doesn't actually point to a page inside the document. |
FPDFEMB_RESULT FPDFEMB_Bookmark_GetTitle | ( | FPDFEMB_BOOKMARK | bookmark, |
void * | buffer, | ||
unsigned int * | bufsize | ||
) |
Function: FPDFEMB_Bookmark_GetTitle Get title of a bookmark
Comments: The title is output in Unicode, using UTF-16LE format. It's terminated by two consecutive zero bytes.
If the "buffer" parameter is NULL, then the "bufsize" parameter will receive number of bytes required to store the bookmark title (including the two- byte terminator).
If the buffer provided is smaller than the required size, then this function will not copy any data, return FPDFEMB_PARAM, and the required buffer size will also be put in "bufsize" parameter.
[in] | bookmark | Handle to the bookmark |
[out] | buffer | A buffer allocated by the application, or NULL. |
[in,out] | bufsize | A pointer to a number indicating the buffer size, before this function call. After return, this place will store number of bytes used by the output (including terminator). |
FPDFEMB_RESULT FPDFEMB_CloseDocument | ( | FPDFEMB_DOCUMENT | document | ) |
Function: FPDFEMB_CloseDocument Close a PDF document and free all associated resources
[in] | document | Document handle |
FPDFEMB_RESULT FPDFEMB_CloseFont | ( | FPDFEMB_FONT | font_handle | ) |
Function: FPDFEMB_CloseFont Close a font handle.
[in] | font_handle | Handle to the font. |
FPDFEMB_RESULT FPDFEMB_ClosePage | ( | FPDFEMB_PAGE | page | ) |
Function: FPDFEMB_ClosePage Close a page and release all related resources
[in] | page | Page handle |
FPDFEMB_RESULT FPDFEMB_ContinueLoadDocument | ( | FPDFEMB_DOCUMENT | document, |
struct FPDFEMB_PAUSE * | pause | ||
) |
Function: FPDFEMB_ContinueLoadDocument Continue loading a PDF document.
[in] | document | Document handle returned by FPDFEMB_StartLoadDocument function |
[in] | pause | A callback mechanism allowing the document loading process to be paused before it's finished. This can be NULL if you don't want to pause. |
FPDFERR_SUCCESS | document successfully loaded. |
FPDFERR_TOBECONTINUED | The document loading can't be finished now. Further call to this function is needed. |
FPDFERR_PASSWORD | incorrect password. |
FPDFERR_FORMAT | not a PDF or corrupted PDF. |
FPDFERR_FILE | file access error. |
FPDFERR_MEMORY | out of memory. |
FPDFERR_STATUS | document already loaded. |
FPDFERR_PARAM | invalid parameter (like NULL document handle) |
FPDFEMB_RESULT FPDFEMB_ContinueParse | ( | FPDFEMB_PAGE | page, |
struct FPDFEMB_PAUSE * | pause | ||
) |
Function: FPDFEMB_ContinueParse Continue the page parsing.
Comments:
FPDFEMB_StartParse should be called before on the page.
Application should call FPDFEMB_ContinueParse repeatedly to finish the parsing when return value is FPDFERR_TOBECONTINUED.
[in] | page | Page handle |
[in] | pause | A structure that can pause the parsing process. Or NULL if you don't want to pause the process. |
FPDFERR_SUCCESS | parsing successfully finished; |
FPDFERR_TOBECONTINUED | parsing performed successfully, but not finished; |
FPDFERR_STATUS | page already parsed (or parsing not started). |
Other | return value error code. |
FPDFEMB_RESULT FPDFEMB_ContinueQuickDraw | ( | FPDFEMB_PAGE | page, |
struct FPDFEMB_PAUSE * | pause | ||
) |
Function: FPDFEMB_ContinueQuickDraw Continue a quick draw processing
[in] | page | Page handle. The page has to be parsed first. |
[in] | pause | Pointer to a structure that can pause the rendering process. Can be NULL if no pausing is needed. |
FPDFERR_SUCCESS | quickdraw successly finished; |
FPDFERR_TOBECONTINUED | quickdraw started successfully, but not finished. more calls to this function needed to finish the quickdraw; |
FPDFERR_STATUS | quickdraw not started yet; |
Other | return value error code. |
FPDFEMB_RESULT FPDFEMB_ContinueRender | ( | FPDFEMB_PAGE | page, |
struct FPDFEMB_PAUSE * | pause | ||
) |
Function: FPDFEMB_ContinueRender Continue the page rendering
Comments:
This function may return any time when the pause interface indicates a pause is needed. Application can call FPDFEMB_ContinueRender any number of times, until FPDFERR_TOBECONTINUED is not returned.
[in] | page | Page handle |
[in] | pause | Pointer to a structure that can pause the rendering process. Can be NULL if no pausing is needed. |
FPDFERR_SUCCESS | rendering successfully finished. |
FPDFERR_TOBECONTINUED | rendering needs to be continued; |
Other | return value error code. |
int FPDFEMB_CountFoundRects | ( | FPDFEMB_PAGE | page | ) |
Function: FPDFEMB_CountFoundRects Get number of rectangles for last found result
[in] | page | Page handle. |
FPDFEMB_RESULT FPDFEMB_CreateDIB | ( | int | width, |
int | height, | ||
int | format, | ||
void * | buffer, | ||
int | stride, | ||
FPDFEMB_BITMAP * | dib | ||
) |
Function: FPDFEMB_CreateDIB Create a DIB (Device Independent Bitmap)
Comments: If "buffer" parameter is not NULL, then the provided buffer must conform to standard DIB format (see comments of FPDFEMB_GetDIBData function below).
This function doesn't initialize the pixels inside the DIB buffer. So if you want to use the DIB to display a PDF page, you usually need to initialize the DIB to white background by youself.
[in] | width | Width pixels; |
[in] | height | Height pixels; |
[in] | format | Format type. See FPDFDIB_xxx constants |
[in] | buffer | External buffer provided for the DIB, or NULL if new buffer is to be allocated. |
[in] | stride | Number of bytes for each scan line, for external buffer only. If not specified, 4-byte alignment assumed. |
[out] | dib | Receiving the created DIB handle |
FPDFEMB_RESULT FPDFEMB_DestroyDIB | ( | FPDFEMB_BITMAP | dib | ) |
Function: FPDFEMB_DestroyDIB Destroy a DIB
Comments: If external buffer is used (specified in "buffer" parameter when calling FPDFEMB_CreateDIB), the buffer will not be destroyed.
[in] | dib | DIB handle |
void FPDFEMB_DeviceToPagePoint | ( | FPDFEMB_PAGE | page, |
int | start_x, | ||
int | start_y, | ||
int | size_x, | ||
int | size_y, | ||
int | rotate, | ||
struct FPDFEMB_POINT * | point | ||
) |
Function: FPDFEMB_DeviceToPagePoint, FPDFEMB_DeviceToPageRect Convert the device coordinations of a point or a rectangle to page coordinations.
Comments:
The page coordination system has its origin at left-bottom corner of the page, with X axis goes along the bottom side to the right, and Y axis goes along the left side upward. No matter how you zoom, scroll, or rotate a page, a particular element (like text or image) on the page should always have the same coordination values in the page coordination system.
The device coordination system is device dependent. For bitmap device, its origin is at left-top corner of the window. You must make sure the start_x, start_y, size_x, size_y and rotate parameters have exactly same values as you used in FPDFEMB_StartRender() function call.
For rectangle conversion, the result rectangle is always "normalized", meaning for page coordinations, left is always smaller than right, bottom is smaller than top.
[in] | page | Handle to the page. Returned by FPDFEMB_LoadPage function. |
[in] | start_x | Left pixel position of the display area in the device coordination |
[in] | start_y | Top pixel position of the display area in the device coordination |
[in] | size_x | Horizontal size (in pixels) for displaying the page |
[in] | size_y | Vertical size (in pixels) for displaying the page |
[in] | rotate | Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise), 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise). |
[in,out] | point | A point structure with device coordinations upon the call, also receiving the result page coordinations. |
void FPDFEMB_DeviceToPageRect | ( | FPDFEMB_PAGE | page, |
int | start_x, | ||
int | start_y, | ||
int | size_x, | ||
int | size_y, | ||
int | rotate, | ||
struct FPDFEMB_RECT * | rect | ||
) |
[in] | page | Handle to the page. Returned by FPDFEMB_LoadPage function. |
[in] | start_x | Left pixel position of the display area in the device coordination |
[in] | start_y | Top pixel position of the display area in the device coordination |
[in] | size_x | Horizontal size (in pixels) for displaying the page |
[in] | size_y | Vertical size (in pixels) for displaying the page |
[in] | rotate | Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise), 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise). |
[in,out] | rect | A rectangle structure with device coordinations upon the call, also receiving the result page coordinations. |
void FPDFEMB_Exit | ( | ) |
Function: FPDFEMB_Exit Stop using FPDFEMB module and release all resources Comments:
All loaded documents and pages will become invalid after this call.
This function is useful for OOM recovery: when your application hits an OOM situation, calling this function will clear all memory allocated by FPDFEMB module, then you can call one of the initialization functions, reopen the document and recovery from OOM.
FPDFEMB_RESULT FPDFEMB_FindFirst | ( | FPDFEMB_PAGE | page, |
const FPDFEMB_WCHAR * | pattern, | ||
FPDFEMB_BOOL | from_last, | ||
unsigned int | flags | ||
) |
Function: FPDFEMB_FindFirst Find first occurrence of a pattern string in a page
Comments:
A page must be parsed first before it can be searched. There can be only one search in progress for a page. A new search will cancel the previous one.
IMPORTANT: this function is now obsolete and kept for back compatibility only, please use FPDFEMB_FindFrom function below.
[in] | page | Page handle. |
[in] | pattern | A zero-terminated unicode string to be found. |
[in] | from_last | Whether we start from the end of page |
[in] | flags | Search flags, see above defined constants |
FPDFEMB_RESULT FPDFEMB_FindFrom | ( | FPDFEMB_PAGE | page, |
const FPDFEMB_WCHAR * | pattern, | ||
int | pos, | ||
unsigned int | flags | ||
) |
Function: FPDFEMB_FindFrom Find first occurrence of a pattern string in a page, from a particular position
Comments: A page must be parsed first before it can be searched. There can be only one search in progress for a page. A new search will cancel the previous one.
[in] | page | Page handle. |
[in] | pattern | A zero-terminated unicode string to be found. |
[in] | pos | The position, returned from FPDFEMB_GetSearchPos. Or 0 from the beginning of page, -1 from the end of page. |
[in] | flags | Search flags, see above defined constants |
FPDFEMB_RESULT FPDFEMB_FindNext | ( | FPDFEMB_PAGE | page | ) |
Function: FPDFEMB_FindNext Find next occurrence of a search
[in] | page | Page handle. FPDFEMB_FindFirst must be called for this page first. |
FPDFEMB_RESULT FPDFEMB_FindPrev | ( | FPDFEMB_PAGE | page | ) |
Function: FPDFEMB_FindPrev Find previous occurrence of a search
[in] | page | Page handle. FPDFEMB_FindFirst must be called for this page first. |
void FPDFEMB_FreeCaches | ( | ) |
Function: FPDFEMB_FreeCaches Free all expendable caches used by FPDFEMB in order to save memory.
Comments:
When an application memory manager runs out of memory, before an OOM situation is raised, the application can try this
void FPDFEMB_FreeMemory | ( | void * | pointer | ) |
Function: FPDFEMB_FreeMemory Free allocated memory
[in] | pointer | Pointer returned by FPDFEMB_AllocMemory |
FPDFEMB_RESULT FPDFEMB_GetCharCount | ( | FPDFEMB_PAGE | page, |
int * | count | ||
) |
Function: FPDFEMB_GetCharCount Get number of characters in the page
[in] | page | Page handle |
[out] | count | Receiving number of characters |
FPDFEMB_RESULT FPDFEMB_GetCharIndexAtPos | ( | FPDFEMB_PAGE | page, |
double | x, | ||
double | y, | ||
int * | index | ||
) |
Function: FPDFEMB_GetCharIndexAtPos() Get index of character nearest to a certain position on the page
Comments: This function finds the character that's nearest to the particular page position. If there is no character, the output index will be -1.
[in] | page | Page handle |
[in] | x | X position in PDF page coordination system |
[in] | y | Y position in PDF page coordination system |
[in] | index | Pointer to an integer receiving zero-based character index. |
FPDFEMB_RESULT FPDFEMB_GetCharInfo | ( | FPDFEMB_PAGE | page, |
int | index, | ||
struct FPDFEMB_CHAR_INFO * | char_info | ||
) |
Function: FPDFEMB_GetCharInfo Get character information
Comments: Application must call FPDFEMB_GetCharCount first before it can call this function for any particular characters.
[in] | page | Page handle |
[in] | index | Character index, starting from zero |
[out] | char_info | Receiving the character info |
FPDFEMB_RESULT FPDFEMB_GetContentMargin | ( | FPDFEMB_PAGE | page, |
int * | left, | ||
int * | top, | ||
int * | right, | ||
int * | bottom, | ||
unsigned long | backcolor | ||
) |
Function: FPDFEMB_GetContentMargin Get content margin
[in] | page | Page handle |
[out] | left | Receiving the left margin (in hundredth of points) |
[out] | top | Receiving the top margin (in hundredth of points) |
[out] | right | Receiving the right margin (in hundredth of points) |
[out] | bottom | Receiving the bottom margin (in hundredth of points) |
[in] | backcolor | Color for intended background in the page. In 0xRRGGBB format. |
void* FPDFEMB_GetDIBData | ( | FPDFEMB_BITMAP | dib | ) |
Function: FPDFEMB_GetDIBData Get data pointer to a DIB
Comments: DIB data are organized in scanlines, from top down.
[in] | dib | DIB handle |
int FPDFEMB_GetDIBHeight | ( | FPDFEMB_BITMAP | dib | ) |
Function: FPDFEMB_GetDIBHeight Get height (in pixels) of a DIB
[in] | dib | DIB handle |
int FPDFEMB_GetDIBStride | ( | FPDFEMB_BITMAP | dib | ) |
Function: FPDFEMB_GetDIBStride Get scan line stride of a DIB
[in] | dib | DIB handle |
int FPDFEMB_GetDIBWidth | ( | FPDFEMB_BITMAP | dib | ) |
Function: FPDFEMB_GetDIBWidth Get width (in pixels) of a DIB
[in] | dib | DIB handle |
FPDFEMB_RESULT FPDFEMB_GetDocInfoString | ( | FPDFEMB_DOCUMENT | document, |
const char * | key, | ||
void * | buffer, | ||
unsigned int * | bufsize | ||
) |
Function: PDFEMB_GetDocInfoString Get information string about the document, like creator, modification date, etc.
Comments: The string is output in Unicode, using UTF-16LE format. It's terminated by two consecutive zero bytes.
If the "buffer" parameter is NULL, then the "bufsize" parameter will receive number of bytes required to store the string (including the two-byte terminator).
[in] | document | Handle to the document |
[in] | key | A byte string for the information key. Currently can be one of the followings: "Title", "Author", "Subject", "Keywords", "Creator", "Producer", "CreationDate", "ModDate", or some custom information key, if supported by the PDF file. |
[out] | buffer | A buffer allocated by the application, or NULL. |
[in,out] | bufsize | A pointer to a number indicating the buffer size (number of bytes), before this function call. After return, this place will store number of bytes used by the output (including terminator). |
FPDFEMB_RESULT FPDFEMB_GetFoundRect | ( | FPDFEMB_PAGE | page, |
int | index, | ||
struct FPDFEMB_RECT * | rect | ||
) |
Function: FPDFEMB_GetFoundRect Get a particular found rectangle
Comments: Application should always call FPDFEMB_CountFoundRects first to get number of rectangles, then use this function to get each rectangle.
The returned rectangle uses page coordination system.
[in] | page | Page handle. |
[in] | index | Zero-based index for the rectangle. |
[out] | rect | Receiving the result rectangle, in hundredth of points |
FPDFEMB_RESULT FPDFEMB_GetGlyphIndex | ( | FPDFEMB_FONT | font_handle, |
int | encoding, | ||
unsigned long | char_code, | ||
unsigned long * | glyph_index | ||
) |
Function: FPDFEMB_GetGlyphIndex Get glyph index of a character
[in] | font_handle | Handle to the font. |
[in] | encoding | Encoding, see the above FPDFEMB_ENCODING_XXX definitions |
[in] | char_code | Character code, depends on the encoding used. For example, if "encoding" is FPDFEMB_ENCODING_UNICODE, then "char_code" should be unicode. |
[out] | glyph_index | Receiving the result glyph index. |
FPDFEMB_RESULT FPDFEMB_GetGlyphWidth | ( | FPDFEMB_FONT | font_handle, |
unsigned long | glyph_index, | ||
unsigned long * | width | ||
) |
Function: FPDFEMB_GetGlyphWidth Get width of a glyph in a font
[in] | font_handle | Handle to the font. |
[in] | glyph_index | Index of the glyph in font. |
[out] | width | Receiving the character width, in 1/1000 of design size (em) |
FPDFEMB_RESULT FPDFEMB_GetPageBBox | ( | FPDFEMB_PAGE | page, |
struct FPDFEMB_RECT * | rect | ||
) |
Function: FPDFEMB_GetPageBBox Get displayable area (bounding box) of a page
[in] | page | Page handle |
[out] | rect | Pointer to a structure receiving the rectangle |
int FPDFEMB_GetPageCount | ( | FPDFEMB_DOCUMENT | document | ) |
Function: Get page count Get number of pages in the document
[in] | document | Document handle |
FPDFEMB_RESULT FPDFEMB_GetPageLabel | ( | FPDFEMB_DOCUMENT | document, |
int | nPage, | ||
void * | buffer, | ||
unsigned int * | bufsize | ||
) |
Function: FPDFEMB_GetPageLabel Get Page label
Comments: The string is output in Unicode, using UTF-16LE format. It's terminated by two consecutive zero bytes.
If the "buffer" parameter is NULL, then the "bufsize" parameter will receive number of bytes required to store the string (including the two-byte terminator).
[in] | document | Handle to the document |
[out] | nPage | Page index |
[out] | buffer | A buffer allocated by the application, or NULL. |
[in,out] | bufsize | A pointer to a number indicating the buffer size (number of bytes), before this function call. After return, this place will store number of bytes used by the output (including terminator). |
FPDFEMB_RESULT FPDFEMB_GetPageSize | ( | FPDFEMB_PAGE | page, |
int * | width, | ||
int * | height | ||
) |
Function: FPDFEMB_GetPageSize Get size of a page
[in] | page | Page handle |
[out] | width | Receiving page width, in hundredth of points |
[out] | height | Receiving page height, in hundredth of points |
int FPDFEMB_GetParseProgress | ( | FPDFEMB_PAGE | page | ) |
Function: FPDFEMB_GetParseProgress Get an estimated parsing progress in percentage
[in] | page | Page handle |
int FPDFEMB_GetRenderProgress | ( | FPDFEMB_PAGE | page | ) |
Function: FPDFEMB_GetRenderProgress Get an estimated rendering progress in percentage
[in] | page | Page handle |
FPDFEMB_RESULT FPDFEMB_GetRotatedDIB | ( | FPDFEMB_BITMAP | dib, |
FPDFEMB_BOOL | bFlipX, | ||
FPDFEMB_BOOL | bFlipY, | ||
FPDFEMB_BITMAP * | result_dib | ||
) |
Function: FPDFEMB_GetRotatedDIB Swap X/Y dimensions of a DIB to generate a rotated new DIB
[in] | dib | DIB handle |
[in] | bFlipX | Whether flip pixels on the destination X dimension (left/right) |
[in] | bFlipY | Whether flip pixels on the destination Y dimension (up/down) |
[out] | result_dib | Receiving the result DIB handle |
int FPDFEMB_GetSearchPos | ( | FPDFEMB_PAGE | page | ) |
Function: FPDFEMB_GetSearchPos Return position of current search result
[in] | page | Page handle. |
FPDFEMB_RESULT FPDFEMB_Init | ( | struct FPDFEMB_MEMMGR * | mem_mgr | ) |
Function: FPDFEMB_Init Initialize the FPDFEMB module.
Comments:
This function will allocate necessary internal data structure for the whole module to operate.
[in] | mem_mgr | Pointer to memory manager structure. |
FPDFEMB_RESULT FPDFEMB_InitEx | ( | struct FPDFEMB_MEMMGR_EX * | mem_mgr | ) |
Function: FPDFEMB_InitEx Initialize the FPDFEMB module with the extended memory manager Comments:
This function will allocate necessary internal data structure for the whole module to operate.
[in] | mem_mgr | Pointer to memory manager structure. |
FPDFEMB_RESULT FPDFEMB_InitFixedMemory | ( | void * | memory, |
int | size, | ||
FPDFEMB_FIXED_OOM_HANDLER | oom_handler | ||
) |
Function: FPDFEMB_InitFixedMemory Initialize the FPDFEMB module, providing a fixed memory heap.
Comments:
In many embedded system, memory usage are predetermined. The application is assigned with fixed size of available memory, then it can pre-allocate a memory block with maximum size and pass to this function to initialize FPDFEMB module. In this case, FPDFEMB won't need any additional memory allocation.
In case the pre-allocated memory has run out, the "oom_proc" callback function will be called to notify the application that an OOM recovery procedure needs to be performed.
[in] | memory | Pointer to a pre-allocated memory block. |
[in] | size | Number of bytes in the memory block. |
[in] | oom_handler | Pointer to a function which will be called when OOM happens. Can be NULL if application doesn't want to be notified om OOM. |
FPDFEMB_RESULT FPDFEMB_InitFixedMemory2 | ( | void * | memory, |
int | size, | ||
struct FPDFEMB_MEMMGR2 * | callbacks, | ||
FPDFEMB_FIXED_OOM_HANDLER | oom_handler | ||
) |
Function: FPDFEMB_InitFixedMemory2 Initialize FPDFEMB using an extensible fixed memory manager. With this kind of manager, when current memory pool runs out, the application may provide some additional memory block for the manager to use.
[in] | memory | Pointer to a pre-allocated memory block |
[in] | size | Number of bytes in the memory block |
[in] | callbacks | Callback functions when FPDFEMB runs out of current memory pool, or when a pool become empty and can be dropped |
[in] | oom_handler | Pointer to a function which will be called when OOM happens. Can be NULL if application doesn't want to be notified om OOM. |
FPDFEMB_RESULT FPDFEMB_Link_GetAction | ( | FPDFEMB_PAGE | page, |
int | link_index, | ||
FPDFEMB_ACTION * | action | ||
) |
Function: FPDFEMB_Link_GetAction Get action(s) associated with a particular hyperlink
[in] | page | Page handle |
[in] | link_index | Zero-based index for the link |
[out] | action | Receiving handle of first action |
FPDFEMB_RESULT FPDFEMB_Link_GetArea | ( | FPDFEMB_PAGE | page, |
int | link_index, | ||
int | area_index, | ||
struct FPDFEMB_POINT * | points | ||
) |
Function: FPDFEMB_Link_GetArea Get a particular quadrilateral for a link
Comments: The result in "points" array are the X/Y coordinations for the four vertices of the quadrilateral. Vertices are in the following order: lower left, lower right, upper right, upper left.
[in] | page | Page handle |
[in] | link_index | Zero-based index for the link |
[in] | area_index | Zero-based index for the quadrilateral |
[out] | points | - Pointer to an array consists 4 points, receiving coordinations |
FPDFEMB_RESULT FPDFEMB_Link_GetAreaCount | ( | FPDFEMB_PAGE | page, |
int | link_index, | ||
int * | count | ||
) |
Function: FPDFEMB_Link_GetAreaCount Get number of area (quadrilaterals) for a link
[in] | page | Page handle |
[in] | link_index | Zero-based index for the link |
[out] | count | Pointer to an integer receiving number of quadrilaterals |
FPDFEMB_RESULT FPDFEMB_Link_GetCount | ( | FPDFEMB_PAGE | page, |
int * | link_count, | ||
int | reserved | ||
) |
Function: FPDFEMB_Link_GetCount Get number of hyperlinks inside a page
Comments: This function must be called before any other link related function can be called for the page.
[in] | page | Page handle. |
[out] | link_count | Pointer to an integer receiving the number of links |
[in] | reserved | Must be zero now. |
void FPDFEMB_LoadCMap_CNS | ( | ) |
void FPDFEMB_LoadCMap_GB | ( | ) |
Function: FPDFEMB_LoadCMap_GB Function: FPDFEMB_LoadCMap_GB_Ext Function: FPDFEMB_LoadCMap_CNS Function: FPDFEMB_LoadCMap_Korean Function: FPDFEMB_LoadCMap_Japan Function: FPDFEMB_LoadCMap_Japan_Ext Make use of character encoding maps embedded with FPDFEMB
Comments: These functions add character encoding data to your application. Each call will increase the code size of your application. Total data size for all character sets is around 434K bytes.
void FPDFEMB_LoadCMap_GB_Ext | ( | ) |
Load full code table for GB.
void FPDFEMB_LoadCMap_Japan | ( | ) |
void FPDFEMB_LoadCMap_Japan_Ext | ( | ) |
Load full code table for Japan.
void FPDFEMB_LoadCMap_Korea | ( | ) |
void FPDFEMB_LoadJbig2Decoder | ( | ) |
Enable JBIG2 decoder.
void FPDFEMB_LoadJpeg2000Decoder | ( | ) |
Enable JPEG2000 decoder.
FPDFEMB_RESULT FPDFEMB_LoadPage | ( | FPDFEMB_DOCUMENT | document, |
int | index, | ||
FPDFEMB_PAGE * | page | ||
) |
Function: FPDFEMB_LoadPage Load a page
[in] | document | Document handle |
[in] | index | Page index, starting from zero |
[out] | page | Receiving the loaded page handler |
FPDFEMB_RESULT FPDFEMB_OpenFileFont | ( | struct FPDFEMB_FILE_ACCESS * | file, |
FPDFEMB_FONT * | font_handle | ||
) |
Function: FPDFEMB_OpenFileFont Load a font from a file
Comments: FPDFEMB only supports TrueType or Type1 font.
[in] | file | Pointer to file access structure. This structure must be kept valid as long as the font is open. |
[out] | font_handle | Receiving the font handle. |
FPDFEMB_RESULT FPDFEMB_OpenStandardFont | ( | int | font_id, |
FPDFEMB_FONT * | font_handle | ||
) |
Function: FPDFEMB_OpenStandardFont Get ready to use a standard PDF font
[in] | font_id | ID of font. See the above FPDFEMB_FONT_XXX definitions. |
[out] | font_handle | Receiving the font handle. |
FPDFEMB_RESULT FPDFEMB_OutputGlyph | ( | FPDFEMB_BITMAP | dib, |
int | x, | ||
int | y, | ||
FPDFEMB_FONT | font_handle, | ||
double | font_size, | ||
struct FPDFEMB_TEXTMATRIX * | matrix, | ||
unsigned long | glyph_index, | ||
unsigned long | argb | ||
) |
Function: FPDFEMB_OutputGlyph Output a glyph onto a DIB device
[in] | dib | DIB handle, as the output device |
[in] | x | DIB x-coordination for the glyph origin |
[in] | y | DIB y-coordination for the glyph origin. |
[in] | font_handle | Handle to the font |
[in] | font_size | Font size in pixels |
[in] | matrix | Matrix for the text output. Can be NULL. |
[in] | glyph_index | Index of glyph to be output |
[in] | argb | Color of the text, in 0xaarrggbb format. |
FPDFEMB_RESULT FPDFEMB_OutputText | ( | FPDFEMB_BITMAP | dib, |
int | x, | ||
int | y, | ||
FPDFEMB_FONT | font_handle, | ||
double | font_size, | ||
struct FPDFEMB_TEXTMATRIX * | matrix, | ||
const FPDFEMB_WCHAR * | text, | ||
unsigned long | argb | ||
) |
Function: FPDFEMB_OutputText Output text string onto a DIB device.
[in] | dib | DIB handle, as the output device |
[in] | x | DIB x-coordination for the origin point of the first character. |
[in] | y | DIB y-coordination for the origin point of the first character. |
[in] | font_handle | Handle to the font |
[in] | font_size | Font size in pixels |
[in] | matrix | Matrix for the text output. Can be NULL. |
[in] | text | Zero-terminated unicode text string |
[in] | argb | Color of the text, in 0xaarrggbb format. |
FPDFEMB_RESULT FPDFEMB_PageLabelToPageNum | ( | FPDFEMB_DOCUMENT | document, |
FPDFEMB_WCHAR * | pagelabel, | ||
int * | pageNum | ||
) |
Function: FPDFEMB_PageLabelToPageNum Get Page Number by Page Label
[in] | document | Handle to the document |
[in] | pagelabel | A zero-terminated unicode page label string to be found. |
[out] | pageNum | Receiving the found page number |
void FPDFEMB_PageToDevicePoint | ( | FPDFEMB_PAGE | page, |
int | start_x, | ||
int | start_y, | ||
int | size_x, | ||
int | size_y, | ||
int | rotate, | ||
struct FPDFEMB_POINT * | point | ||
) |
Function: FPDFEMB_PageToDevicePoint, FPDFEMB_PageToDeviceRect Convert the page coordinations of a point or a rectangle to device coordinations.
Comments:
For rectangle conversion, the result rectangle is always "normalized", meaning for device coordinations, left is always smaller than right, top is smaller than bottom.
[in] | page | Handle to the page. Returned by FPDFEMB_LoadPage function. |
[in] | start_x | Left pixel position of the display area in the device coordination |
[in] | start_y | Top pixel position of the display area in the device coordination |
[in] | size_x | Horizontal size (in pixels) for displaying the page |
[in] | size_y | Vertical size (in pixels) for displaying the page |
[in] | rotate | Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise), 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise). |
[in,out] | point | A point structure with page coordinations upon the call, also receiving the result device coordinations. |
void FPDFEMB_PageToDeviceRect | ( | FPDFEMB_PAGE | page, |
int | start_x, | ||
int | start_y, | ||
int | size_x, | ||
int | size_y, | ||
int | rotate, | ||
struct FPDFEMB_RECT * | rect | ||
) |
[in] | page | Handle to the page. Returned by FPDFEMB_LoadPage function. |
[in] | start_x | Left pixel position of the display area in the device coordination |
[in] | start_y | Top pixel position of the display area in the device coordination |
[in] | size_x | Horizontal size (in pixels) for displaying the page |
[in] | size_y | Vertical size (in pixels) for displaying the page |
[in] | rotate | Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise), 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise). |
[in,out] | rect | A rectangle structure with page coordinations upon the call, also receiving the result device coordinations. |
FPDFEMB_RESULT FPDFEMB_QuickSearch | ( | FPDFEMB_DOCUMENT | document, |
int | page_index, | ||
const FPDFEMB_WCHAR * | pattern, | ||
int | case_sensitive | ||
) |
Function: FPDFEMB_QuickSearch Search a pattern in a page quickly, without the page to be parsed
Comments: This function does a rough and quick search in a page, before the page is loaded. The quick search will not generate an exact result saying where the pattern is found, and, it might be possible if a quick search result is "pattern found", and a real search for the same pattern, in the same page, will result in "not found".
However, if quick search doesn't find a pattern in a page, then we can be sure the pattern won't be found in this page when we do a real search. So, this function is very useful when we search in a multiple-page document, and we want to quickly skip those pages in which the pattern can't possibly be found.
[in] | document | Document handle returned by FPDFEMB_StartLoadDocument function |
[in] | page_index | Zero-based index of the page |
[in] | pattern | A zero-terminated unicode string to be found. |
[in] | case_sensitive | Non-zero for case-sensitive searching, zero for case-insensitive |
void FPDFEMB_SetFileBufferSize | ( | int | size | ) |
Function: FPDFEMB_SetFileBufferSize Set size of internal buffer used to read from source file.
Comments:
Currently FPDFEMB uses 512 bytes as default buffer size. The new buffer size takes effect next time you call FPDFEMB_StartLoadDocument.
[in] | size | Number of bytes. |
FPDFEMB_RESULT FPDFEMB_SetFontMapper | ( | struct FPDFEMB_FONT_MAPPER * | mapper | ) |
Function: FPDFEMB_SetFontMapper Use a system font mapper (typically for Chinese/Japanese/Korean charsets)
Comments: This function is used with devices that come with one or more system fonts, and those fonts are in standard TT or T1 format.
[in] | mapper | Pointer to FPDFEMB_FONT_MAPPER structure. |
void FPDFEMB_SetGlyphProvider | ( | struct FPDFEMB_GLYPH_PROVIDER * | provider | ) |
Function: FPDFEMB_SetGlyphProvider Make use of a glyph provider: generating glyph bitmap for non-Latin characters
Comments: FPDFEMB embeds some standard fonts for Latin characters and symbols, like Times, Courier and Helvetica (Arial). For non-Latin characters, however, FPDFEMB has to ask glyph provide for help.
If an embedded device carries fonts for non-Latin character sets, especially those for CJK markets, then the application can implement a glyph provider, allowing PDFs using non-embedded CJK fonts to be properly displayed.
[in] | provider | Pointer to the glyph provider structure. This structure must stay valid throughout usage of FPDFEMB module. |
void FPDFEMB_SetHalftoneLimit | ( | int | limit | ) |
Function: FPDFEMB_SetHalftoneLimit Set pixel count limit for using halftone when display image
Comments:
By default, FPDFEMB displays all bitmaps using downsamping, which means if the image is shrinked onto screen, only part of pixels will be picked and displayed. This saves a lot of calculation, especially for big images with millions of pixels. However the display quality can be bad. In order to reach a balance between performance and quality, application can use this function to set a limit, if number of pixels in an image is more than this limit, then FPDFEMB will use downsampling for quick drawing, otherwise, if the image has less pixels, FPDFEMB will use halftoning for better quality.
[in] | limit | Number of pixels for the limit |
void FPDFEMB_SetLogProc | ( | void(*)(const char *msg) | proc | ) |
Function: FPDFEMB_SetLogProc Set a logging procedure to output debugging messages from FPDFEMB
[in] | proc | A callback function for output logging info |
FPDFEMB_RESULT FPDFEMB_StartLoadDocument | ( | struct FPDFEMB_FILE_ACCESS * | file, |
const char * | password, | ||
FPDFEMB_DOCUMENT * | document, | ||
struct FPDFEMB_PAUSE * | pause | ||
) |
Function: FPDFEMB_StartLoadDocument Start loading a PDF document
Comments: Document loading is a progressive process. It might take a long time to load a document, especially when a file is corrupted, FPDFEMB will try to recover the document contents by scanning the whole file. If "pause" parameter is provided, this function may return FPDFERR_TOBECONTINUED any time during the document loading.
When FPDFERR_TOBECONTINUED is returned, the "document" parameter will still receive a valid document handle, however, no further operations can be performed on the document, except the "FPDFEMB_ContineLoadDocument" function call, which resume the document loading.
[in] | file | Pointer to file access structure. This structure must be kept valid as long as the document is open. |
[in] | password | Pointer to a zero-terminated byte string, for the password. Or NULL for no password. |
[out] | document | Receiving the document handle |
[in] | pause | A callback mechanism allowing the document loading process to be paused before it's finished. This can be NULL if you don't want to pause. |
FPDFERR_SUCCESS | document successfully loaded. |
FPDFERR_TOBECONTINUED | The document loading can't be finished now. See comments below. |
FPDFERR_PASSWORD | incorrect password. |
FPDFERR_FORMAT | not a PDF or corrupted PDF. |
FPDFERR_FILE | file access error. |
FPDFERR_MEMORY | out of memory. |
FPDFEMB_RESULT FPDFEMB_StartParse | ( | FPDFEMB_PAGE | page, |
FPDFEMB_BOOL | text_only, | ||
struct FPDFEMB_PAUSE * | pause | ||
) |
Function: FPDFEMB_StartParse Start parsing a page, so it can get rendered or searched.
Comments:
Parsing is a progressive process. This function starts the parsing process, and may return before parsing is finished, if a pause structure is provided.
Application should call FPDFEMB_ContinueParse repeatedly to finish the parsing when return value is FPDFERR_TOBECONTINUED.
There can be only one parsing procedure active for a page, and if a page has already been parsed, you can't start a parsing again.
[in] | page | Page handle |
[in] | text_only | flag for parsing texts only (used for searching) |
[in] | pause | A structure that can pause the parsing process. Or NULL if you don't want to pause the process. |
FPDFERR_SUCCESS | parsing successfully finished; |
FPDFERR_TOBECONTINUED | parsing started successfully, but not finished; |
FPDFERR_STATUS | page already parsed, or parsing already started. Other return value: error code. |
FPDFEMB_RESULT FPDFEMB_StartQuickDraw | ( | FPDFEMB_BITMAP | dib, |
FPDFEMB_PAGE | page, | ||
int | start_x, | ||
int | start_y, | ||
int | size_x, | ||
int | size_y, | ||
int | rotate, | ||
int | flags, | ||
struct FPDFEMB_PAUSE * | pause | ||
) |
Function: FPDFEMB_StartQuickDraw Start drawing a quick preview of a page Comments: It's often useful to present user a quick preview of a page, right after the page is parsed. This preview renders only a limited set of easy features in the page, so it'll be rather quick to finish this process.
[in] | dib | DIB handle, as the rendering device |
[in] | page | Page handle. The page has to be parsed first. |
[in] | start_x | Left pixel position of the display area in the device coordination |
[in] | start_y | Top pixel position of the display area in the device coordination |
[in] | size_x | Horizontal size (in pixels) for displaying the page |
[in] | size_y | Vertical size (in pixels) for displaying the page |
[in] | rotate | Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise), 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise). |
[in] | flags | Reserved, must be zero. |
[in] | pause | Pointer to a structure that can pause the rendering process. Can be NULL if no pausing is needed. |
FPDFERR_SUCCESS | quickdraw successfully finished; |
FPDFERR_TOBECONTINUED | quickdraw started successfully, but not finished. |
FPDFEMB_ContinueQuickDraw | needs to be called to finish the quickdraw; |
FPDFERR_STATUS | quickdraw already in progress, or page not parsed; |
Other | return value: error code. |
FPDFEMB_RESULT FPDFEMB_StartRender | ( | FPDFEMB_BITMAP | dib, |
FPDFEMB_PAGE | page, | ||
int | start_x, | ||
int | start_y, | ||
int | size_x, | ||
int | size_y, | ||
int | rotate, | ||
int | flags, | ||
struct FPDFEMB_RECT * | clip, | ||
struct FPDFEMB_PAUSE * | pause | ||
) |
Function: FPDFEMB_StartRender Start rendering of a page.
Comments:
Rendering is a progressive process. This function starts the rendering process, and may return before rendering is finished, if a pause structure is provided.
Application should call FPDFEMB_ContinueRender repeatedly to finish the rendering when return value is FPDFERR_TOBECONTINUED.
There can be only one rendering procedure for a page at any time. And rendering can be started over and over again for the same page. If a page rendering is already active, starting another one will cancel the previous rendering.
Rendering of a page doesn't draw the page background, therefore, you usually need to draw the background in the DIB yourself.
[out] | dib | DIB handle, as the rendering device |
[in] | page | Page handle. The page has to be parsed first. |
[in] | start_x | Left pixel position of the display area in the device coordination |
[in] | start_y | Top pixel position of the display area in the device coordination |
[in] | size_x | Horizontal size (in pixels) for displaying the page |
[in] | size_y | Vertical size (in pixels) for displaying the page |
[in] | rotate | Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise), 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise). |
[in] | flags | 0 for normal display, or combination of flags defined above |
[in] | clip | Pointer to clip rectangle (in DIB device coordinations), or NULL if no clipping needed. |
[in] | pause | Pointer to a structure that can pause the rendering process. Can be NULL if no pausing is needed. |
FPDFERR_SUCCESS | rendering successfully finished; |
FPDFERR_TOBECONTINUED | rendering started successfully, but not finished; |
Other | return value error code. |
FPDFEMB_RESULT FPDFEMB_StretchDIB | ( | FPDFEMB_BITMAP | dest_dib, |
int | dest_left, | ||
int | dest_top, | ||
int | dest_width, | ||
int | dest_height, | ||
struct FPDFEMB_RECT * | clip_rect, | ||
FPDFEMB_BITMAP | src_dib, | ||
FPDFEMB_BOOL | interpol | ||
) |
Function: FPDFEMB_StretchDIB Stretch a source DIB into another destination DIB
[out] | dest_dib | The destination DIB handle |
[in] | dest_left | Left position in the destination DIB |
[in] | dest_top | Top position in the destination DIB |
[in] | dest_width | Destination width, in pixels. Can be negative for horizontal flipping |
[in] | dest_height | Destination height, in pixels. Can be negative for vertical flipping |
[in] | clip_rect | Destination clipping rectangle, or NULL for no clipping. The coordinations are measured in destination bitmap. |
[in] | src_dib | Source DIB handle. |
[in] | interpol | Whether we use interpolation to improve the result quality |
FPDFEMB_RESULT FPDFEMB_TransformDIB | ( | FPDFEMB_BITMAP | dest_dib, |
struct FPDFEMB_RECT * | clip_rect, | ||
FPDFEMB_BITMAP | src_dib, | ||
int | x, | ||
int | y, | ||
int | xx, | ||
int | yx, | ||
int | xy, | ||
int | yy, | ||
FPDFEMB_BOOL | interpol | ||
) |
Function: FPDFEMB_TransformDIB Transform a source DIB into another destination DIB
Comments: All coordinations and distances are measured in destination bitmap system.
This function places the bottom-left pixel of the image at the destination origin, then the bottom sideline along the destination X vector, and left sideline along the destination Y vector.
[out] | dest_dib | The destination DIB handle |
[in] | clip_rect | Destination clipping rectangle, or NULL for no clipping. The coordinations are measured in destination bitmap. |
[in] | src_dib | Source DIB handle. |
[in] | x | X coordination of the dest origin |
[in] | y | Y coordination of the dest origin |
[in] | xx | X distance of the dest X vector |
[in] | yx | Y distance of the dest X vector |
[in] | xy | X distance of the dest Y vector |
[in] | yy | Y distance of the dest Y vector |
[in] | interpol | Whether we use interpolation to improve the result quality |
void FPDFEMB_UseExternalData | ( | const unsigned char * | data, |
unsigned int | size | ||
) |
Function: FPDFEMB_UseExternalCMaps Make use of external data for FPDFEMB
Comments: Some embedded system has limitation on program size, therefore we might not be able to embed a lot of data (like cmap data and embedded font data) into the FPDFEMB library. We introduced this function so device can choose to store those data outside of program, and make it available to FPDFEMB using this function. The data has to be provided by Foxit.
This function is only available in library specially built for using external data.
[in] | data | Pointer to the external data |
[in] | size | Number of bytes in the external data. |