Do you have an issue with a specific file(s)?Yes
Can you reproduce using one of our samples or online demos?
Are you using the WebViewer server?
Does the issue only happen on certain browsers?
Is your issue related to a front-end framework?
Is your issue related to annotations?
Please give a brief summary of your issue:
(Think of this as an email subject)
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
Please provide a link to a minimal sample where the issue is reproducible:
When i am creating new highlight annotation i dont have quads i have rect but not able to convert rect to quads so text is not highlighting
Thank you for contacting us about WebViewer. Would it be possible to get a bit more information on what you are trying to do? How are you getting the “rect” data to create highlight annotations? Normally you can convert “rect” to “quad” by doing something like the following
let newHighlight = new Annotations.TextHighlightAnnotation();
// "rect" would be the two corners of a rectangle
let exampleRect = {
x1: 104.08,
x2: 264.29,
y1: 390.94,
y2: 436.82
};
newHighlight.Author = annotationManager.getCurrentUser();
newHighlight.PageNumber = 1;
// highlight takes an array of "Quad" in case you are highlighting multiple lines
// "Quad" take in X/Y pairs, so (x1, y1, x2, y2, x3, y3, x4, y4)
newHighlight.Quads = [new Annotations.Quad(
exampleRect.x1, exampleRect.y1,
exampleRect.x2, exampleRect.y1,
exampleRect.x2, exampleRect.y2,
exampleRect.x1, exampleRect.y2
)];
newHighlight.StrokeColor = new Annotations.Color(0, 255, 255);
annotationManager.addAnnotation(newHighlight);
annotationManager.redrawAnnotation(newHighlight);
You can find out more in the links below
Please let me know if the above helps or if you want me to clarify something
Best Regards,
Andrew Yip
Software Developer
PDFTron Systems, Inc. www.pdftron.com