1
我正在一個cordova APP中的PDJS視圖上工作。PDFJs在iPAD上的模糊PDF
一切工作正常,但PDF是有點模糊。我知道這是由於視網膜顯示,但我怎樣才能改變這個奧得我如何得到正確的尺度?
目前我試試這個
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);
});
你有沒有設法弄清楚這一點?我有完全一樣的問題。 – distante
是的,仍然需要幫助嗎? –
@distante急?否則,我將在稍後提供答案 –