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?
Koteg source
share