Commit 49ca98e3 by xiaowenfeng

把PDF预览改为不渲染html的模式

parent 231d2d0d
Showing with 12 additions and 9 deletions
......@@ -172,6 +172,7 @@ export default {
startTime: null,
scale: 2, // 缩放比例
borderSize: 9, // viewerContainer容器border大小
shouldRenderHtml: false, // pdf预览时是否需要渲染成html
pageSize: 1,
selected: 2,
pdfUrl: "",
......@@ -227,15 +228,17 @@ export default {
viewport
);
this.renderCanvas(bufferCanvas, viewport, page);
let textContent = await page.getTextContent();
this.renderHtml(
textLayerDiv,
page,
scale,
viewport,
bodyHeight,
textContent
);
if (this.shouldRenderHtml) {
let textContent = await page.getTextContent();
this.renderHtml(
textLayerDiv,
page,
scale,
viewport,
bodyHeight,
textContent
);
}
},
initPage(page, viewport) {
$("#page").css("height", $("body").height() - $(".toolbar").height());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment