render canvas on-screen to avoid bad fonts in MSIE

This commit is contained in:
Brian Gough 2016-10-13 09:30:04 +01:00
parent bfeb7e082f
commit 4ca918a3b8

View file

@ -245,6 +245,12 @@ define [
return
canvas = $('<canvas class="pdf-canvas pdfng-rendering"></canvas>')
# In Windows+IE we must have the canvas in the DOM during
# rendering to see the fonts defined in the DOM. If we try to
# render 'offscreen' then all the text will be sans-serif.
# Previously we rendered offscreen and added in the canvas
# when rendering was complete.
element.canvas.replaceWith(canvas)
viewport = page.getViewport (scale)
@ -298,7 +304,6 @@ define [
result.then () ->
# page render success
element.canvas.replaceWith(canvas)
canvas.removeClass('pdfng-rendering')
page.getTextContent().then (textContent) ->
textLayer.setTextContent textContent