Can I find the shape annotation in the PDF Viewer?

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 :)


3 Replies 1 reply marked as answer

SK Shamini Kiruba Sobers Syncfusion Team April 6, 2022 06:59 PM UTC

Hi TaeWook,


We are checking to achieve your requirement. We will update further details on April 8, 2022.


Regards,

Shamini



SK Shamini Kiruba Sobers Syncfusion Team April 11, 2022 04:24 PM UTC

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



SK Shamini Kiruba Sobers Syncfusion Team April 21, 2022 08:18 AM UTC

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:   

   

Blazor Client    

https://www.nuget.org/packages/Syncfusion.Blazor/   

Blazor Sever   

https://www.nuget.org/packages/Syncfusion.Blazor.PdfViewerServer.Windows   

Service side package      

ASP.NET Core :      

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Core.Windows/ 
https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Core.Linux/    
   

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Core.OSX/      

       

ASP.NET MVC:      

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Mvc5/      

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Mvc4/      

  

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


Marked as answer
Loader.
Up arrow icon