Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import PSPDFKit, { Geometry } from "pspdfkit"
- const instance = await PSPDFKit.load({
- container: "#pdf-view",
- pdf: "/sales-report.pdf"
- });
- instance.setViewState(viewState => viewState.zoomIn());
- const annotations = await instance.getAnnotations(0);
- const point = new Geometry.Point({ x: 20, y: 30 });
- const annotationsAtPointInPage = annotationsOnFirstPage.filter(annotation =>
- annotation.boundingBox.isPointInside(point)
- );
- instance.addEventListener("annotations.create", createdAnnotations => {
- console.log(createdAnnotations);
- });
- PSPDFKit.unload("#pdf-view");
Add Comment
Please, Sign In to add comment