Take the 2-minute tour ×

I want to search text in pdf in chinese. I am using CGPDFScanner. I can't get the correct text with CIDFontType2.

my font object has ToUnicode entry

fontName is HFKAAO+LinGothic-Bold

it has CIDToGIDMap entry with name identity (pdf document said it means truetype font program is embedded)

Registry is Adobe
Ordering is Identity

it has FontFile2 entry in FontDescriptor Filter with FlateDecode

I found someone said I just inflate the text I got from Tj but that does not work... I used zlib to inflate the text , and it seems that it is not produce correct data.

Is there any sample code that I can study?

I just found https://github.com/KurtCode/PDFKitten but it can not work with chinese....

share|improve this question
add comment

1 Answer

I found the problem

I just use CMap to translate the string form Tj

there is a bug in my code that I decode the CMap

after I fix the bug, every thing is ok


share|improve this answer
add comment

Your Answer


