I am using pdf.js.
But, image quality of PDF is low quality.
Please tell me solution method.
var TARGET_PAGE = 1;
var PAGE_SCALE = 1;
function
I've had the same issue. Just changed 'scale' attribute from 1 to 2 and the quality went way up.
pdfDoc.getPage(1)
.then(function (page) {
var canvas = document.getElementById('myCanvas');
var ctx = canvas.getContext('2d');
var viewport = page.getViewport(2); // 2 is the 'scale' attr
canvas.height = viewport.height;
canvas.width = viewport.width;
var renderContext = {
canvasContext: ctx,
viewport: viewport
};
page.render(renderContext);
});