Definitions for reflow related operation.
Definitions and functions in this module are included in fpdf_reflow_r.h.
Module: PDFReflow
License Identifier: PDFReflow/All
Available License Right: Reading.
More...
Classes | |
struct | FSPDF_REFLOWPAGE |
Handle type to PDF reflow page. More... | |
Functions | |
FS_RESULT | FSPDF_ReflowPage_Create (FSCRT_PAGE pdfPage, FSPDF_REFLOWPAGE *reflowPage) |
Create a reflow page from a PDF page. More... | |
FS_RESULT | FSPDF_ReflowPage_Release (FSPDF_REFLOWPAGE reflowPage) |
Release all resources allocated for a PDF reflow page handle. More... | |
FS_RESULT | FSPDF_ReflowPage_SetSize (FSPDF_REFLOWPAGE reflowPage, FS_FLOAT width, FS_FLOAT height) |
Set screen size before calling function FSPDF_ReflowPage_StartParse. More... | |
FS_RESULT | FSPDF_ReflowPage_SetLineSpace (FSPDF_REFLOWPAGE reflowPage, FS_FLOAT lineSpace) |
Set line space before calling function FSPDF_ReflowPage_StartParse. More... | |
FS_RESULT | FSPDF_ReflowPage_SetTopSpace (FSPDF_REFLOWPAGE reflowPage, FS_FLOAT topSpace) |
Set the top space of page before calling function FSPDF_ReflowPage_StartParse. More... | |
FS_RESULT | FSPDF_ReflowPage_StartParse (FSPDF_REFLOWPAGE reflowPage, FS_DWORD flags, FSCRT_PROGRESS *reflowProgress) |
Start parsing process for a reflow page. More... | |
FS_RESULT | FSPDF_ReflowPage_GetContentSize (FSPDF_REFLOWPAGE reflowPage, FS_FLOAT *width, FS_FLOAT *height) |
Get width and height of a reflow page after calling function FSPDF_ReflowPage_StartParse. More... | |
FS_RESULT | FSPDF_ReflowPage_GetMatrix (FSPDF_REFLOWPAGE reflowPage, FS_INT32 x, FS_INT32 y, FS_INT32 width, FS_INT32 height, FS_INT32 rotation, FSCRT_MATRIX *matrix) |
Get matrix of a reflow page. More... | |
FS_RESULT | FSPDF_RenderContext_StartReflowPage (FSPDF_RENDERCONTEXT pdfRenderContext, FSCRT_RENDERER renderer, FSPDF_REFLOWPAGE reflowPage, FSCRT_PROGRESS *renderProgress) |
Start rendering a reflow page. More... | |
FS_RESULT | FSPDF_ReflowPage_GetFocusData (FSPDF_REFLOWPAGE reflowPage, const FSCRT_MATRIX *matrix, FS_INT32 x, FS_INT32 y, FSCRT_BSTR *focusData) |
Get focus data corresponding to a given position in device coordinate system. More... | |
FS_RESULT | FSPDF_ReflowPage_GetFocusPosition (FSPDF_REFLOWPAGE reflowPage, const FSCRT_MATRIX *matrix, const FSCRT_BSTR *focusData, FS_INT32 *x, FS_INT32 *y) |
Get a point of a position in device coordinate system corresponding to a given focus data. More... | |
Macro Definitions for Reflow Parser Flags | |
#define | FSPDF_REFLOWFLAG_NORMAL 0x0 |
Reflow parsing flag for normal mode, without image. | |
#define | FSPDF_REFLOWFLAG_IMAGE 0x1 |
Reflow parsing flag for image mode. | |
#define | FSPDF_REFLOWFLAG_NOTRUNCATE 0x2 |
Reflow parsing flag for single screen mode. More... | |
Definitions for reflow related operation.
Definitions and functions in this module are included in fpdf_reflow_r.h.
Module: PDFReflow
License Identifier: PDFReflow/All
Available License Right: Reading.
This module contains following features:
#define FSPDF_REFLOWFLAG_NOTRUNCATE 0x2 |
Reflow parsing flag for single screen mode.
The flag can avoid that truncate problem the bottom of screen displaying the upper part of last text or image in single screen mode. The truncate problem is related to the height of the set by calling FSPDF_ReflowPage_SetSize and if it is not set this flag, the screen could display the upper part of text in the last line or image. It can improve the effect when reading single screen mode, however, the scroll screen mode would be affected.
FS_RESULT FSPDF_ReflowPage_Create | ( | FSCRT_PAGE | pdfPage, |
FSPDF_REFLOWPAGE * | reflowPage | ||
) |
Create a reflow page from a PDF page.
[in] | pdfPage | Handle to a FSCRT_PAGE object which is a PDF page object. |
[out] | reflowPage | Pointer to a FSPDF_REFLOWPAGE handle to receive the new reflow page handle if successful. Application should release this handle if not use it any more by calling function FSPDF_ReflowPage_Release. |
FS_RESULT FSPDF_ReflowPage_GetContentSize | ( | FSPDF_REFLOWPAGE | reflowPage, |
FS_FLOAT * | width, | ||
FS_FLOAT * | height | ||
) |
Get width and height of a reflow page after calling function FSPDF_ReflowPage_StartParse.
[in] | reflowPage | Handle to a FSPDF_REFLOWPAGE object returned by function FSPDF_ReflowPage_Create. |
[out] | width | Pointer to a float that receives the width of reflow page. |
[out] | height | Pointer to a float that receives the height of reflow page. |
FS_RESULT FSPDF_ReflowPage_GetFocusData | ( | FSPDF_REFLOWPAGE | reflowPage, |
const FSCRT_MATRIX * | matrix, | ||
FS_INT32 | x, | ||
FS_INT32 | y, | ||
FSCRT_BSTR * | focusData | ||
) |
Get focus data corresponding to a given position in device coordinate system.
Focus data of a specific content is fixed, and will not change because of different sizes of reflow pages, which are retrieved from the same PDF page of the same content. So focus data can be used to locate the same content of a PDF page in reflow pages with different sizes but same reflow content.
[in] | reflowPage | Handle to a FSPDF_REFLOWPAGE object returned by function FSPDF_ReflowPage_Create. This should have been parsed successfully by calling function FSPDF_ReflowPage_StartParse. |
[in] | matrix | Pointer to a FSCRT_MATRIX structure returned by function FSPDF_ReflowPage_GetMatrix. |
[in] | x | X-coordinate of a specific position, in device coordinate system. |
[in] | y | Y-coordinate of a specific position, in device coordinate system. |
[out] | focusData | Pointer to a FSCRT_BSTR structure that receives the focus data corresponding to the specific position. |
FS_RESULT FSPDF_ReflowPage_GetFocusPosition | ( | FSPDF_REFLOWPAGE | reflowPage, |
const FSCRT_MATRIX * | matrix, | ||
const FSCRT_BSTR * | focusData, | ||
FS_INT32 * | x, | ||
FS_INT32 * | y | ||
) |
Get a point of a position in device coordinate system corresponding to a given focus data.
Focus data of a specific content is fixed, and will not change because of different sizes of reflow pages, which are retrieved from same PDF page and with same content. So focus data can be used to locate the same content of a PDF page in reflow pages with different sizes but same reflow content.
[in] | reflowPage | Handle to a FSPDF_REFLOWPAGE object returned by function FSPDF_ReflowPage_Create. This should have been parsed successfully by calling function FSPDF_ReflowPage_StartParse. |
[in] | matrix | Pointer to a FSCRT_MATRIX structure returned by function FSPDF_ReflowPage_GetMatrix. |
[in] | focusData | Focus data used to get its corresponding position in device coordinate system, with specific matrix. This is returned by function FSPDF_ReflowPage_GetFocusData. |
[out] | x | Pointer to a FS_INT32 object that receives x-coordinate of a position. This position is just corresponding to given focus data in device coordinate system. |
[out] | y | Pointer to a FS_INT32 object that receives y-coordinate of a position. This position is just corresponding to given focus data in device coordinate system. |
FS_RESULT FSPDF_ReflowPage_GetMatrix | ( | FSPDF_REFLOWPAGE | reflowPage, |
FS_INT32 | x, | ||
FS_INT32 | y, | ||
FS_INT32 | width, | ||
FS_INT32 | height, | ||
FS_INT32 | rotation, | ||
FSCRT_MATRIX * | matrix | ||
) |
Get matrix of a reflow page.
[in] | reflowPage | Handle to a FSPDF_REFLOWPAGE object returned by function FSPDF_ReflowPage_Create. This should have been parsed successfully by calling function FSPDF_ReflowPage_StartParse. |
[in] | x | Left pixel of the display area in the device coordinate system. |
[in] | y | Top pixel of the display area in the device coordinate system. |
[in] | width | Horizontal size (in pixels) for displaying the page. |
[in] | height | Vertical size (in pixels) for displaying the page. |
[in] | rotation | Page orientation. Valid values are:
|
[out] | matrix | Pointer to a FSCRT_MATRIX struct that receives the output matrix. |
FS_RESULT FSPDF_ReflowPage_Release | ( | FSPDF_REFLOWPAGE | reflowPage | ) |
Release all resources allocated for a PDF reflow page handle.
[in] | reflowPage | Handle to a FSPDF_REFLOWPAGE object returned by function FSPDF_ReflowPage_Create. |
Set line space before calling function FSPDF_ReflowPage_StartParse.
[in] | reflowPage | Handle to a FSPDF_REFLOWPAGE object returned by function FSPDF_ReflowPage_Create. |
[in] | lineSpace | The line space. Default value: 0. |
Set screen size before calling function FSPDF_ReflowPage_StartParse.
[in] | reflowPage | Handle to a FSPDF_REFLOWPAGE object returned by function FSPDF_ReflowPage_Create. |
[in] | width | Width of desired page. This value should be more than 20. |
[in] | height | Height of desired page. This value should be more than 20. |
Set the top space of page before calling function FSPDF_ReflowPage_StartParse.
The function is used to set the distance between the page's top and the screen's top when to reflow a page.
[in] | reflowPage | Handle to a FSPDF_REFLOWPAGE object returned by function FSPDF_ReflowPage_Create. |
[in] | topSpace | The top space of page when to reflow and this value should be equal or greater than zero. Default value: 0. |
FS_RESULT FSPDF_ReflowPage_StartParse | ( | FSPDF_REFLOWPAGE | reflowPage, |
FS_DWORD | flags, | ||
FSCRT_PROGRESS * | reflowProgress | ||
) |
Start parsing process for a reflow page.
It may take a long time to parsing a reflow page, so Foxit PDF SDK uses a progressive process to do this.
Caller should set parameter reflowProgress and call function FSCRT_Progress_Continue to continue parsing in steps if necessary, and should call function FSCRT_Progress_Release to destroy reflowProgress object after parsing process.
All the resources about reflow page will be loaded after the reflow page is parsed.
Function FSPDF_ReflowPage_SetSize must be called before this function sets the screen size. And this function should be called before any getting reflow method can be used.
[in] | reflowPage | Handle to a FSPDF_REFLOWPAGE object returned by function FSPDF_ReflowPage_Create. |
[in] | flags | Reflow parsing mode. It should be one of the following macro definitions: |
[out] | reflowProgress | Pointer to a FSCRT_PROGRESS handle that receives a handle of progressive process if successful. |
FS_RESULT FSPDF_RenderContext_StartReflowPage | ( | FSPDF_RENDERCONTEXT | pdfRenderContext, |
FSCRT_RENDERER | renderer, | ||
FSPDF_REFLOWPAGE | reflowPage, | ||
FSCRT_PROGRESS * | renderProgress | ||
) |
Start rendering a reflow page.
It will take a long time to render reflow a page with complex or large contents, so Foxit PDF SDK uses a progressive process to do this.
Caller should pass renderProgress to FSCRT_Progress_Continue to continue rendering in steps, and should call FSCRT_Progress_Release to destroy renderProgress object after rendering process.
[in] | pdfRenderContext | Handle to a FSPDF_RENDERCONTEXT object which is a PDF rendering context, created by function FSPDF_RenderContext_Create. |
[in] | renderer | Handle to a FSCRT_RENDERER object which represents a rendering engine, created by function FSCRT_Renderer_CreateOnBitmap or platform-dependednt renderer creating functions. |
[in] | reflowPage | Handle to a FSPDF_REFLOWPAGE object returned by function FSPDF_ReflowPage_Create. This should have been parsed successfully by calling function FSPDF_ReflowPage_StartParse. |
[out] | renderProgress | Pointer to a FSCRT_PROGRESS handle that receives a handle of progressive process if successful. |