mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-24 14:31:59 +00:00
insert the pdf text and annotations after the page has been rendered
This commit is contained in:
parent
7071ee3540
commit
25521d1a26
1 changed files with 9 additions and 10 deletions
|
@ -151,28 +151,27 @@ define [
|
|||
textLayerDiv: element.text[0]
|
||||
viewport: viewport
|
||||
})
|
||||
page.getTextContent().then (textContent) ->
|
||||
console.log 'text content is', textContent
|
||||
window.RENDER_DELAY = 0
|
||||
textLayer.setTextContent textContent
|
||||
|
||||
annotationsLayer = new pdfAnnotations({
|
||||
annotations: element.annotations[0]
|
||||
viewport: viewport
|
||||
navigateFn: @navigateFn
|
||||
})
|
||||
page.getAnnotations().then (annotations) ->
|
||||
console.log 'annotations are', annotations
|
||||
window.RENDER_DELAY = 0
|
||||
annotationsLayer.setAnnotations annotations
|
||||
|
||||
element.canvas.replaceWith(canvas)
|
||||
canvas.removeClass('pdf-canvas-new')
|
||||
|
||||
return @renderTask = page.render {
|
||||
canvasContext: ctx
|
||||
viewport: viewport
|
||||
}
|
||||
.then () ->
|
||||
element.canvas.replaceWith(canvas)
|
||||
canvas.removeClass('pdf-canvas-new')
|
||||
page.getTextContent().then (textContent) ->
|
||||
console.log 'text content is', textContent
|
||||
textLayer.setTextContent textContent
|
||||
page.getAnnotations().then (annotations) ->
|
||||
console.log 'annotations are', annotations
|
||||
annotationsLayer.setAnnotations annotations
|
||||
|
||||
addSpinner: (element) ->
|
||||
h = element.height()
|
||||
|
|
Loading…
Reference in a new issue