PXCV_ReleaseCachedData

<< Click to Display Table of Contents >>

Navigation:  Functions >

PXCV_ReleaseCachedData


 

pdf-xchange-editor-simple-sdk_100x100 PXCV_ReleaseCachedData

 


 

PXCV_ReleaseCachedData releases cached document data.

 

HRESULT  PXCV_ReleaseCachedData(

     PXVDocument Doc,

     DWORD dwFlags

);

 

Parameters

 

Doc

[in] Specifies a document that PXCV_Init created.

 

dwFlags

[in] Specifies the cached content to be freed. The flag pxvrcd_ReleaseDocumentFonts is the only flag available for this parameter, and it features the value 0x0002. See PXCV_ReleasePageCachedData for further information on this parameter.

 

Please note that all functions and parameters are case-sensitive.

 

Return Values

 

If the function succeeds then the return value is DS_OK.

 

If the function fails then the return value is an error code.

 

Comments

 

This function clears all cached data for the document, which means the next rendering operations will require re-reading and conversion of some data. However, clearing cached data may free a significant quantity of used memory. Therefore a call to this function is recommended after several pages have been rendered, especially if they will not be be reused.

 

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.