WebViewer Version: 10.9.0
Do you have an issue with a specific file(s)? - No
Can you reproduce using one of our samples or online demos? - NA
Are you using the WebViewer server? - No
Does the issue only happen on certain browsers? - No
Is your issue related to a front-end framework? - No
Is your issue related to annotations? - Yes
Please give a brief summary of your issue:
(Think of this as an email subject)
Unable to use TextHighlightAnnotation when bounds are present in Pixels unit
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
We are integrating with a service which gives us highlighted text information in pixels like
bounds : {
"bottom": 2652,
"left": 228,
"right": 355,
"top": 2624
}
I am using following code to highlight text on PDF
const { left , right , bottom , top} = bounds;
const quad = new Math.Quad(
left,
bottom,
right,
bottom,
right,
top,
left,
top
);
const textAnnotation = new Annotations.TextHighlightAnnotation({
PageNumber: page,
FillColor: new Annotations.Color(255, 255, 0, 1),
StrokeColor: new Annotations.Color(255, 255, 0, 1),
Quads: [quad]
});
annotationManager.addAnnotation(textAnnotation);
annotationManager.redrawAnnotation(textAnnotation);
this doesnt highlight anything , though when i try to convert these pixels to something pdftron expects like by dividing each pixel unit by 4 , i am able to see the text highlighted. but to be confident about the approach i need to have the logic to create the conversion factor . can you please provide a solution to this problem as this looks like a very basic use case of highlght.
Please provide a link to a minimal sample where the issue is reproducible: