Created
October 17, 2017 15:11
-
-
Save philipp-spiess/dbf6290ee3515210afa2dc38e27b5c1a to your computer and use it in GitHub Desktop.
PSPDFKit for Web Code Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! I was looking for this
PSPDFKit.unload("#pdf-view");