[reportlab-users] jpg image quality in pdf's

Robin Becker robin at reportlab.com
Wed Nov 2 03:36:52 EST 2005

Britt Hibbert wrote:
> Hi, 
> I am having troubles importing jpg images into a reportlab-generated pdf. Specifically, the quality of the images in the pdf is not acceptable to my client. In particular, it seems to be the text within these images that breaks up considerably when placed in the document.  With the same image placed into a  WinWord document , the text does not break up. The fonts used within the saved image are TrueType fonts. However, when I use these TrueType fonts directly within the pdf document using the Paragraph flowable, they render beautifully.
>  I have imported the image using the Image flowable. I've tried with no set width and height, as well as with every scale from .1 of an inch up to the actual size of the the image (scaling both the width and  height values so that they remain in proportion to each other) .  I have searched the archives of this list, and come accross some similar reports to image quality issues, but found no references to definite solutions to this problem. 
> Can anyone tell me why this image quality issue comes up, and if there's anything I can do about it? I am able to use any type of image that I need to if it helps. However, I have run my tests with both jpg and png images and the results seem to be similar. 
> thanks in advance for any help 
> Britt Hibbert


The intention of the reportlab toolkit image handling is to use jpeg 
natively so either we have a bug or the problem lies in the way PDF 
handles the jpeg. It would help if you could send me a sample jpeg that 
illustrates the problem. I can then check whether we're doing the right 
thing. It is certainly true that the font used in the image should have 
no bearing on the outcome; we treat it as a binary blob and don't care 
what's inside.
Robin Becker

More information about the reportlab-users mailing list