PDFKitten emphasizes incorrect position

I use PDFKitten to search for strings in PDF documents with highlighting results. FastPDFKit or any other commercial library is not an option, so I stick to the one closest to my requirements.

Wrong coordinate

As you can see in the screenshot, I was looking for the string "in", which is always correctly highlighted, except for the last one. I have a more complex PDF document in which the highlighted field for "in" is almost 40% wrong.

, . , , , , , - .

, - RenderingState.m. , , , - PDFKitten .

PDF- PDFKitten .

+5
1

PDFKitten , .

appendPDFString StringDetector :

// Use CID string for font-related computations.
NSString *cidString = [font stringWithPDFString:string];

// Use Unicode string to compare with user input.
NSString *unicodeString = [[font stringWithPDFString:string] lowercaseString];

stringWithPDFString Font unicode.

, , cidString , unicode. didScanCharacter, : widthOfCharacter ( "" (CID), fontsize "), , .

, CID , . /fi- CID 12, Unicode 0xfb01.

PDFKitten , didScanCID StringDetector, appendPDFString didScanCharacter , CID. , .

. , widthOfCharacter ( ), , , unicode ...

(, , "Java-...:))

+4

All Articles