MacOS X 10.9 - Link to the previous version (Apple) PDFKit framework

Mac OS X 10.7.5 causes a sequential (and undocumented) change in behavior in the Quartz-PDFKit method

characterBoundsAtIndex

PDFPage class .

When you receive your text pdfPageas NSStringwith

text = [pdfPage string];

and get the unicode character in position idxusing

unichr = [text characterAtIndex: idx]; // (1)

You expect to get your borders (position and size) on the page with

bounds = [pdfPage characterBoundsAtIndex: idx]; // (2)

Using the same index value.

WRONG

After 10.7.5, there is no longer 1-1 correspondence with the index value (1) and the index value (2) , and worse, it is not provided for the transfer from the first to the last.

(, , , , ), , " 10.7. 5" assumpiont, .

PDFKit OS X 10.7 , :

OS X 10.7 PDFKit ?

?

+4
2

Troughton-Smith .

PDFKit, . PDFKit - , , ; CorePDF, CoreGraphics...

otool -L /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/PDFKit.framework/Versions/A/PDFKit

, 10.7.5 10.7.5.

PDFKit Foundation 10.7.5, , , 10.7.5 .

segmentation fault.

, 10.7.5 PDFKit 10.9.2, .

+2

, . *

install_name_tool, Xcode, ( @executable_path/../Frameworks/ ).


, , , , , . , 10.7 → 10.9, , . , , , .

: iOS - , iOS 5 Google Maps iOS 6+.


* , ( ) / . , , , .

.

+3

Source: https://habr.com/ru/post/1523681/


All Articles