Flush Method of the FRPage Object

This method unloads and, if necessary, saves to disk the ImageDocument and the Layout objects corresponding to the FRPage object if there are no references to them. Saving to disk is an option, you can omit this stage if the data has not been changed.

The method is useful when processing documents of large sizes, in which case it decreases memory usage. After the operation on a separate document page is complete, free all references to the ImageDocument and the Layout objects corresponding to the page and call the Flush method to decrease memory usage.

Note that if you have made changes to the page and want to keep these changes, you should call Flush with the IsSaveRequired parameter set to TRUE. Otherwise, the changes can be lost when calling other methods that free memory (see Iterating Document Pages for details).



  VARIANT_BOOL  IsSaveRequired,


bool Flush(bool IsSaveRequired);

Visual Basic .NET

Function Flush(Boolean IsSaveRequired) As Boolean


[in] Specifies whether to save changes done to the page. Pass FALSE if the page has not been changed or saving changes is not required.
[out, retval] The pointer to the variable that receives the method execution result. The result is TRUE if the method completed successfully, and FALSE otherwise.

Return values

This method has no specific return values. It returns standard return codes of ABBYY FineReader Engine functions.


The behavior of the Flush method depends on the value of the IFRDocument::PageFlushingPolicy property. If the value of PageFlushingPolicy is PFP_FlushToDisk, a call to the method unloads layout and image documents to disk. If it is PFP_Auto, a call to the method unloads the data to disk, if there are more than 30 pages in the document; otherwise, the data is kept in memory. If it is PFP_KeepInMemory, the data is not unloaded. This is convenient when you process both small and large documents in one solution, as you can use the same code for processing.

See also


Iterating Document Pages

3/24/2023 8:51:52 AM

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.