<< Click to Display Table of Contents >> Navigation: Functions > PXCV_ReleasePageCachedData |
This function releases page-specific, cached data for one document page. (It also contains optional functionality to release global/shared resources used subsequently to the initial release of data. See Comments for further information).
HRESULT PXCV_ReleasePageCachedData(
PXVDocument Doc,
DWORD page_num,
DWORD dwFlags
);
Doc
[in] Specifies a document that PXCV_Init created.
page_num
[in] Specifies the zero-based page number for which cached data should be released.
dwFlags
[in] Specifies the cached content to be freed. Any combination of the following flags is possible:
Name
|
Value
|
Meaning
|
pxvrcd_ReleaseDocumentImages
|
0x0001
|
Release used images.
|
pxvrcd_ReleaseDocumentFonts
|
0x0002
|
Release used embedded fonts.
|
pxvrcd_ReleaseGlobalFonts
|
0x0004
|
Release used global (unembedded) fonts.
|
Please note that all functions and parameters are case-sensitive.
If the function succeeds then the return value is DS_OK.
If the function fails then the return value is an error code.
•This function releases data used to render a specified page (as opposed to all cached document data). If dwFlags is zero (0) then only the content-rendering operators for the page specified will be released. This function is recommended when a page has been rendered that is unlikely to be rendered again soon. Additionally, it is recommended that the pxvrcd_ReleaseDocumentImages flag is used to call PXCV_ReleaseCachedData, as images are not usually shared between adjacent pages.
•The PDF rasterizer requires significant memory usage for many operations, including: sequences of rendering operators, sharing fonts between pages for text rendering, sharing non-embedded fonts between documents and sharing images between pages. All of these objects must be converted into internal, rasterized representations before being used, which is likely to be a time-consuming operation. The PDF rasterizer keeps all objects as internal representations in order to accelerate page rendering. This is most significant when several parts of the same page are rendered sequentially. This is because it means that some objects will not require repeated conversion during subsequent rendering operations. However, some objects require a lot of memory - for example a "simple" page of text may contain several thousand rendering operators - therefore it may become necessary to free cached objects in order to free used memory. Two functions are provided to achieve this: PXCV_ReleaseCachedData and PXCV_ReleasePageCachedData.