Open jamesioppolo opened 1 year ago
I think there is an argument that this library should be modified to use coordinatesFromPdf as the default highlight state, rather than the existing boundingRect approach. The former would enable more advanced manipulation of highlights and highlights to be added 'headlessly' without rendering the dom
Can you please clarify the calculation of the bounding rectangle for the “Type Checking for Javascript” example shown on the webpage https://agentcooper.github.io/react-pdf-highlighter/ ?
Coordinate Values from PDF
A string find query on the PDF itself (https://arxiv.org/pdf/1708.08021.pdf) for the string “Type Checking for Javascript” obtains the following coordinate values:
Hardcoded values in example
However, the hardcoded value in the example to highlight the subtext “Type Checking for javascript” requires the definition the hardcoded coordinates below (https://github.com/agentcooper/react-pdf-highlighter/blob/main/example/src/test-highlights.ts#L5)
Transformation function
x1, y1, x2, y2, width
andheight
are obtained ?