Pdf image quality is bad using pdf.js

前端 未结 4 1996
执笔经年
执笔经年 2021-02-13 05:49

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         


        
4条回答
  •  花落未央
    2021-02-13 06:36

    Looks like the problem with your PAGE_SCALE=1. You just telling to render a page with px equal to PDF unit (the latter is 1/72 inch). Typical page size in PDF units is 612x792. Most of displays are 110-146 dpi nowadays. and if you want to get a page on your 3008x1692 screen, you will be looking at scale 2.0-5.0 times.

    Major mistake people do is applying CSS scale on the CANVAS. If your CSS scale does not place logical CANVAS pixel on screen pixels, you will get blurry image effect. (See also Canvas drawing and Retina display: doable?)

提交回复
热议问题