Untitled
Anonymous
javascript
07/30/2024 11:17 AM
676 B
29
Indexable
const handleSearch = (query) => {
if (instance) {
instance.search(query).then((results) =>
const annotations = results.map((result) => {
return new PSPDFKit.Annotations.HighlightAnnotation({
pageIndex: result.pageIndex,
rects: result.rectsOnPage,
boundingBox: PSPDFKit.Geometry.Rect.union(result.rectsOnPage)
});
});
annotations.forEach((annotation) => {
instance.create(annotation);
});
});Editor is loading...
Leave a Comment