Text Hightlight created using PDFViewControl in C# needs to map exact location on the same document using WebViewViewer in Angular TextHighlight

Product Version: “@pdftron/webviewer”: “^8.6.1”,

Text Highlight created using PDFViewControl in C# needs to map the exact location on the same document using WebViewViewer in Angular TextHighlight

we were using the PDFView control in C#, now we are using Angular WebViewer. The text highlights collected using PDFViewCtrl consists on #pageNumber and #Rect i.e, x1, x2. y1, y2

I am using the below code to map the exact highlight but the different area is highlighted, Is there any way by which I can map the rectangle and pgNo to Angular web viewer control?

    const hl = new this.wvInstance.Annotations.TextHighlightAnnotation();

    hl.PageNumber = 101;
    hl.StrokeColor = new Annotations.Color(255, 255, 31);
    hl.Quads = [this.wvInstance.Core.Math.Rect(353.431, 537.633,448.324,560.791).toQuad()];
    annotationManager.addAnnotation(hl);
    annotationManager.redrawAnnotation(hl);

This is our prime requirement to show the highlights collected using PDFViewCtrl in C# maps
exactly at the same location using Angular SDK ("@pdftron/webviewer": “^8.6.1”,)

Regards,
Sameer

Hello @sameerghorpade,

There are differences in the coordinate when using WebViewer, but there are utility functions to convert between PDF and viewer coordinates. You can read more about it here:

Best Regards,
Armando Bollain
Software Developer
PDFTron Systems, Inc.