Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Webviewer({
  2.   initialDoc: ...,
  3.   path: '/lib',
  4. }, document.getElementById('viewer')).then(instance => {
  5.  
  6.   const { Annotations, docViewer, Actions } = instance
  7.  
  8.   const rect = new Annotations.Rect(10,10,10,10)
  9.  
  10.   const link = new Annotations.Link({ rect: rect})
  11.   link.setWidth(200)
  12.   link.setHeight(200)
  13.   link.PageNumber = 1
  14.  
  15.   const destination = new Actions.GoTo.Dest({ page: 4})
  16.   const goToAction = new Actions.GoTo({dest: destination})
  17.   link.addAction('U', goToAction);
  18.  
  19.   const annotManager = docViewer.getAnnotationManager()
  20.   annotManager.addAnnotation(link)
  21.  
  22. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement