我正在科尔多瓦 APP 中处理 PDJS 视图。
一切正常,除了 pdf 有点模糊。我知道这在某种程度上是因为视网膜显示,但我怎样才能改变这个 oder 如何获得正确的比例?
目前我尝试这个
pdfFile.getPage(data.page).then(function (page) {
canvas.width = $('#pdfContainer').width();
var viewport = page.getViewport(canvas.width / (page.getViewport(1).width));
canvas.width = viewport.width;
canvas.height = viewport.height;
var height= $('#pdfContainer').height();
if (canvas.height > height) {
canvas.height = height;
var viewport = page.getViewport(canvas.height / (page.getViewport(1).height));
canvas.width = viewport.width;
canvas.height = viewport.height;
}
var renderContext = {
canvasContext: context,
viewport: viewport
};
page.render(renderContext);
});