Hi.
I want to find the text in the shape annotation in the PDF Viewer and zoom in to that location. Can I implement this function?
I really need your advice.
thank you :)
Hi TaeWook,
We are checking to achieve your requirement. We will update further details on April 8, 2022.
Regards,
Shamini
Hi TaeWook,
Currently, we don’t have support to find the text in the shape annotation and zoom in to that location. However, we are exposing an API called ZoomToRect(Rect zoomRect) which helps to zoom into the specified annotation area by passing the shape annotation bounds taken from the annotation collections. This API will be available in our upcoming weekly NuGet release on April 20, 2022. Kindly let us know if it will be helpful for you in any way.
Regards,
Shamini
Hi TaeWook,
We cannot zoom in to a specific text location using the zoomToRect(Rect zoomRect) method. The zoomToRect(Rect zoomRect) method zooms only a specific area of the annotations, shapes, and form fields present in the PDF document. Please refer to the below code snippet.
Code Snippet:
|
Var bounds = viewer.annotationCollection[0].bounds; Var pageNumber = viewer.annotationCollection[0].pageNumber; var pagePoint = { x: bounds.left, y: bounds.top }; var clientPoint = viewer.convertPagePointToClientPoint(pagePoint, parseInt(pageNumber) + 1); var rectangle = new DOMRect(clientPoint.x, clientPoint.y, bounds.width, bounds.height); viewer.zoomToRect(rectangle);
|
The method was exposed in our latest weekly release v20.1.0.50.
Packages:
CDN: http://cdn.syncfusion.com/ej2/20.1.50/dist/ej2.min.js
https://cdn.syncfusion.com/ej2/20.1.50/material.css
Kindly try this by upgrading to the latest version and let us know if it helps.
Regards,
Shamini