Pdf full-text search on iPad with quartz 2D

I am trying to implement full-text search using Quartz 2D, but this is a nightmare. I can "extract" text from a pdf page using a PDF operator (TJ and others ...)

    CGPDFOperatorTableRef myTable;

myTable = CGPDFOperatorTableCreate();

CGPDFOperatorTableSetCallback (myTable, "BT", &op_BT);
CGPDFOperatorTableSetCallback (myTable, "Td", &op_Td);
CGPDFOperatorTableSetCallback (myTable, "TD", &op_TD);
CGPDFOperatorTableSetCallback (myTable, "Tm", &op_Tm);
CGPDFOperatorTableSetCallback (myTable, "T*", &op_T);
CGPDFOperatorTableSetCallback (myTable, "TJ", &op_TJ);
CGPDFOperatorTableSetCallback (myTable, "Tf", &op_TF);
CGPDFOperatorTableSetCallback (myTable, "ET", &op_ET);

But at the same time, I need to highlight the coincidence on the PDF page with some rectangle, for example, in Safari. Any suggestions on how to implement this? Are there any solutions that do not require such a huge job?

+3
source share
1 answer

This is just the tip of the iceberg ...

"", TJ, , "" .

PDF- "" (Tf). - , "" , .

"" , . - ( ..), .

, /ToUnicode, unicode. , .

... , unicode...

... : PDF "" , . , ...

, .

+4

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


All Articles