This is a sample react pdf reader with annotation
import PDFReader from "rl-react-pdf"
const handleSelectArea = (position) => {
// SAMPLE 'POSITION' OBJECT STRUCTURE
// position = {
// boundingRect: {
// x1: 255.73419189453125,
// y1: 139.140625,
// x2: 574.372314453125,
// y2: 165.140625,
// width: 809.9999999999999,
// height: 1200
// },
// rects: [
// {
// x1: 255.73419189453125,
// y1: 139.140625,
// x2: 574.372314453125,
// y2: 165.140625,
// width: 809.9999999999999,
// height: 1200
// }
// ],
// pageNumber: 1
// }
}
<PDFReader url={"LOCATION/TO/PDF"} onSelectArea={handleSelectArea} />