Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #11256 Reply


    I am considering using PlugPDF on iOS, and I have a few technical questions:

    1) We have a text indexing engine which supports very advanced features (multiple search terms, proximity searches, patterns, regular expressions…), and I would like to display a document using PlugPDF, and highlight the words found by our engine.

    I am considering using [PlugPDFDocument extractTextAndRects:inRect:], but I need a reliable way to match each character in @”Text” with the corresponding rectangle in @”Rects”.

    As the string length does not match the array length, how to do this? It seems that, with my test document, there is a rect for each character except U000a. Are there other characters with no rect, for example U000d, U000b, U2028? How are decomposed characters and surrogate pairs handled?

    Maybe this method could return an empty rect for each character with no glyph.

    2) I have a sample document containing characters from the supplementary planes (emoticons), which should appear as surrogate pairs in the NSString, but they are not returned at all (some rectangles are correctly returned). Is this a known issue?

    3) I have another sample document where the returned text is truncated.
    Sometimes, extractTextAndRects:inRect: returns empty text and rects, but extractText:inRect: actually returns the text. I also have lots of crashes (using version 2.9.7) when calling extractTextAndRects:inRects: or immediately after. Can I help with crash logs and sample files?

    4) I am adding some highlight annotations using saveAnnot:, but the annotation is saved to the file on disk. Is there a way to add an annotation on screen, but without altering the file? I tried [annot setDocument:] and [annot setDocumentView:], but the annotation is not shown.


    #11262 Reply

    Dr. Plug

    Hello Jerome,

    Thank you for the inquiry with a detailed explanations.
    But could you give us a PDF file that problem has?
    Actually without PDF, it is hard to reproduce the problems you said.
    If you give us a PDF file and let us know how to reproduce that problem, it would be very helpful to solve that problem.

    Best Regards

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: [PlugPDFDocument extractTextAndRects:inRect:] (iOS)
Your information: