Guest User

Untitled

a guest
Oct 18th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import PSPDFKit, { Geometry } from "pspdfkit"
  2.  
  3. const instance = await PSPDFKit.load({
  4. container: "#pdf-view",
  5. pdf: "/sales-report.pdf"
  6. });
  7.  
  8. instance.setViewState(viewState => viewState.zoomIn());
  9.  
  10. const annotations = await instance.getAnnotations(0);
  11. const point = new Geometry.Point({ x: 20, y: 30 });
  12. const annotationsAtPointInPage = annotationsOnFirstPage.filter(annotation =>
  13. annotation.boundingBox.isPointInside(point)
  14. );
  15.  
  16. instance.addEventListener("annotations.create", createdAnnotations => {
  17. console.log(createdAnnotations);
  18. });
  19.  
  20. PSPDFKit.unload("#pdf-view");
Add Comment
Please, Sign In to add comment