IsPdfWithTextualContent Method of Engine Object
This method finds out if any of the pages of PDF file contain text layer. If you need to convert multiple PDF files to searchable PDF, you can check for text layer, and simply copy the whole file if it contains text layer. However, note that the text layer can contain additional or irrelevant text, in which case it's still necessary to perform recognition if you need completely adequate text rendering of the document.
HRESULT IsPdfWithTextualContent( BSTR FileName, IImagePasswordCallback* Callback, VARIANT_BOOL* Result );
bool IsPdfWithTextualContent( string FileName, IImagePasswordCallback Callback );
Visual Basic .NET
Function IsPdfWithTextualContent( _ FileName As String, _ [Callback As IImagePasswordCallback = Nothing] _ ) As Boolean
- [in] This variable contains the full path to the PDF file in which to detect the text layer.
- [in] This variable refers to the interface of the user-implemented object of the type ImagePasswordCallback which is used to handle possible password requests for accessing PDF files. This parameter is optional and may be 0 in which case password-protected files cannot be checked.
- [out, retval] This parameter returns TRUE if at least one of the pages of the file has text layer, and FALSE if none of the pages contain text layer.
This method has no specific return values. It returns the standard return values of ABBYY FineReader Engine functions.
If you are opening PDF files from disk, we recommend using this method and not the CheckTextLayer method of the FRDocument object or HasTextualContent property of the ImageDocument object. This method will work quicker because it will not actually open the file and represent it as FRDocument, but simply check the properties of PDF file for text layer.