How to improve ReportLab image quality?

I am creating a label printer. It consists of a logo and some text, not hard. I already spent 3 days trying to get the original SVG logo to draw on the screen, but the SVG is too complicated using too many gradients, etc.

So, I have a high-quality raster logo (like JPG or PNG) and I draw this on the ReportLab canvas. The image in question is much larger than 85 * 123 pixels. I did this, hoping ReportLab would implement all of this and scale it accordingly. Here is how I do it:

canvas.drawImage('logo.jpg', 22+xoffset, 460, 85, 123)

The problem is that my assumption was wrong. It seems that it reduces to 85 * 123 pixels at screen resolution, which means that it doesn’t look very good when printed.

Does ReportLab have any DPI commands for canvases or documents so that I can maintain quality in accordance with the standards?

+5
source share
2 answers

Earlier at ReportLab, I can tell you that bitmap images do not automatically resample / scale when included in a PDF. The dimensions used 85 * 123 are not pixels, but dots (pt), which are a physical unit, for example, millimeters or inches.

PDF , , , PDF. PDF, ( , , PDF ).

, , :

, , 2 , 72 , 144. , 300 ( ), 600 .

+8

, , : PDF .

5, , 350DPI... .

+1

All Articles