I’m currently working on a feature that allows users to extract text and numbers from a selected area of a PDF document. The user will be able to choose the area by dragging a rectangle over the desired region. I have already implemented an API that prints the rectangle and retrieves text based on the provided coordinates, which is functioning correctly. However, I now need to enable users to interactively select the coordinates by dragging the rectangle. It’s important to note that the interaction should not be affected by rotation or zooming.
I’m using ReactJS for this project, and I would appreciate guidance on which APIs can assist me in achieving this functionality.
Could it be possible That user draw reactangle on thier own and Then extract text beneath it so basically I want to generate reactangle from user not pre built one
If you want to allow the user to resize the rectangle, you would probably want a prompt to confirm and then extract the text underneath.
Although more effort, if you want to get the event where the user resizes the rectangle annotation, you could try the annotationChanged event and then specify the rectangle annotation. i.e. if (annotations[0] instanceof instance.Core.Annotations.RectangleAnnotation)
By clicking the ‘R’ key on my keyboard, I can effortlessly create rectangle annotations in my PDF. Moreover, I have the amazing ability to extract text from these annotations exactly as I desire. However, I wish for this option to be enabled by default whenever I open my PDF. It would be even better if this option were displayed alongside the thumbnail. Unfortunately, despite my thorough exploration of the documentation, I have been unable to locate this particular option. I am currently utilizing React for my project. If you could provide guidance or assistance in finding this option, I would be extremely grateful.
We do not currently have a way to customize the thumbnail panel, but you can choose to customize your UI by following the advanced UI customization guide: