ImageGear for C and C++ on Linux v19.10 - Updated
IG_PDF_doc_create_wordfinder_ucs
API Reference Guide > PDF Component API Reference > PDF Component Objects Reference > General Objects > HIG_PDF_DOC > IG_PDF_doc_create_wordfinder_ucs

Creates a word finder that is used to extract text in the host encoding from a PDF file.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_PDF_doc_create_wordfinder_ucs(
        HIG_PDF_DOC hDoc, 
                SHORT nAlgVersion,
        WORD nFlags, 
                LPVOID lpClientData, 
                LPHIG_PDF_WORDFINDER lphWordFinder 
);

Arguments:

Name Type Description
hDoc HIG_PDF_DOC The document on which the word finder is used.
nAlgVersion SHORT The version of the word-finding algorithm to use.
nFlags WORD Word-finding options that determine the tables filled when using IG_PDF_wordfinder_acquire_word_list. Must be an OR of one or more of enumIGPDFWordFlags.
lpClientData LPVOID Pointer to user-supplied data to pass to the newly created word finder. Set to NULL.
lphWordFinder LPHIG_PDF_WORDFINDER Handle to the new WordFinder.

Return Value:

Error count.

Supported Raster Image Formats:

This function does not process image pixels.

Remarks:

The word finder also extracts text from Form XObjects that are executed in the page contents. For information about Form XObjects, see Section 4.9 in the PDF Reference.

This function also works for non-Roman (CJK or Chinese-Japanese-Korean) viewers. In this case, words are extracted to the host encoding. Users desiring Unicode output must use IG_PDF_doc_create_wordfinder_ucs, which does the extraction for Roman or non-Roman text.

The type of WordFinder determines the encoding of the string returned by IG_PDF_word_get_string. For instance, if IG_PDF_doc_create_wordfinder_ucs is used to create the word finder, IG_PDF_word_get_string returns only Unicode.

For CJK viewers, words are stored internally using CID encoding. For more information on CIDFonts and related topics, see Section 5.6 in the PDF Reference. For detailed information on CIDFonts, see Technical Note #5092, CID-Keyed Font Technology Overview, and Technical Note #5014, Adobe CMap and CIDFont Files Specification.