|
|
@ -624,43 +624,43 @@ var PDFPageView = (function PDFPageViewClosure() { |
|
|
|
onRenderContinue: function (cont) { }, |
|
|
|
onRenderContinue: function (cont) { }, |
|
|
|
cancel: function () { }, |
|
|
|
cancel: function () { }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
} else { // eslint-disable-line no-else-return
|
|
|
|
} |
|
|
|
var cancelled = false; |
|
|
|
|
|
|
|
var ensureNotCancelled = function () { |
|
|
|
var cancelled = false; |
|
|
|
if (cancelled) { |
|
|
|
var ensureNotCancelled = function () { |
|
|
|
throw 'cancelled'; |
|
|
|
if (cancelled) { |
|
|
|
} |
|
|
|
throw 'cancelled'; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var self = this; |
|
|
|
var self = this; |
|
|
|
var pdfPage = this.pdfPage; |
|
|
|
var pdfPage = this.pdfPage; |
|
|
|
var SVGGraphics = pdfjsLib.SVGGraphics; |
|
|
|
var SVGGraphics = pdfjsLib.SVGGraphics; |
|
|
|
var actualSizeViewport = this.viewport.clone({scale: CSS_UNITS}); |
|
|
|
var actualSizeViewport = this.viewport.clone({scale: CSS_UNITS}); |
|
|
|
var promise = pdfPage.getOperatorList().then(function (opList) { |
|
|
|
var promise = pdfPage.getOperatorList().then(function (opList) { |
|
|
|
|
|
|
|
ensureNotCancelled(); |
|
|
|
|
|
|
|
var svgGfx = new SVGGraphics(pdfPage.commonObjs, pdfPage.objs); |
|
|
|
|
|
|
|
return svgGfx.getSVG(opList, actualSizeViewport).then(function (svg) { |
|
|
|
ensureNotCancelled(); |
|
|
|
ensureNotCancelled(); |
|
|
|
var svgGfx = new SVGGraphics(pdfPage.commonObjs, pdfPage.objs); |
|
|
|
self.svg = svg; |
|
|
|
return svgGfx.getSVG(opList, actualSizeViewport).then(function (svg) { |
|
|
|
self.paintedViewport = actualSizeViewport; |
|
|
|
ensureNotCancelled(); |
|
|
|
|
|
|
|
self.svg = svg; |
|
|
|
svg.style.width = wrapper.style.width; |
|
|
|
self.paintedViewport = actualSizeViewport; |
|
|
|
svg.style.height = wrapper.style.height; |
|
|
|
|
|
|
|
self.renderingState = RenderingStates.FINISHED; |
|
|
|
svg.style.width = wrapper.style.width; |
|
|
|
wrapper.appendChild(svg); |
|
|
|
svg.style.height = wrapper.style.height; |
|
|
|
|
|
|
|
self.renderingState = RenderingStates.FINISHED; |
|
|
|
|
|
|
|
wrapper.appendChild(svg); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
promise: promise, |
|
|
|
promise: promise, |
|
|
|
onRenderContinue: function (cont) { |
|
|
|
onRenderContinue: function (cont) { |
|
|
|
cont(); |
|
|
|
cont(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
cancel: function () { |
|
|
|
cancel: function () { |
|
|
|
cancelled = true; |
|
|
|
cancelled = true; |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|