For finding Asian characters in a pdf, normally a Ctrl-F is used. But in order to search a CJK font character, this doesn’t work.

In Acrobat, in order to search CJK characters, an additional setting is required to be done. This setting is to Ignore Asian characters width, which on being set, finds both half-width and full-width instances of the Asian language characters in the search text. Since the Japanese text inserted in the pdf would be double – byte, so this option needs to be set for the font in this pdf file being generated.

For this, the following change is needed in the code of after creating pdeFont the usual way:

sysFont = PDFindSysFont(&pdeFontAttrs, sizeof(PDEFontAttrs), 0); 

pdsysEncoding = PDSysEncodingCreateFromCMapName(pdeFontAttrs.encoding); 

pdeFont = PDEFontCreateFromSysFontAndEncoding(sysFont, pdsysEncoding,  ASAtomNull,  kPDEFontEncodeByGID | kPDEFontCreateToUnicode | kPDEFontCreateEmbedded 
 | kPDEFontWillSubset); 

PDEFontCreateWidthsNow(pdeFont, PDDocGetCosDoc(pdDoc));

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy