2

I found out a lot of articles how to improve the quality of images inside generated PDF document by JasperReports engine, but almost solutions don't work for me or they refer to older version of JasperReports.

Therefore I want to know what is the best approach for my case:

  • I have a list of images and some description for each one. Every image is defined by its URL.
  • Images can have different sizes, but the area for each one is fixed, and it is 500x500.
  • When the image which is inserted into this area larger than it(twice or more), the quality is not so bad than when the image equals to or less then this area.
  • Overrides net.sf.jasperreports.image.dpi doesn't work, I can't convert images to SVG format, and I can't guarantee that every image would be large than the area for it.

I would be glad for any advice what can I do. Thank you in advance!

Vy Do
  • 46,709
  • 59
  • 215
  • 313
ZaptoS
  • 141
  • 1
  • 1
  • 9

1 Answers1

0

I'm not sure how you would want to improve the resolution of small images when displayed in areas larger than their size. We can't increase the resolution of a picture already taken, to make it sharper when scaled up.

The "net.sf.jasperreports.image.dpi" property that you mentioned is used when the engine transforms SVGs or other rendered graphics into pictures. It specifies the resolution of an image produced out of a chart for example. But images elements that display pictures from files such as PNG, JPG, GIF, etc do not have anything to do with that property.

What exactly is not working for you when using RealHeight or RealSize?

Teodor Danciu
  • 221
  • 2
  • 4
  • Teodor, I know that "image.dpi" isn't relevant to my case, but I've just wanted to prevent useless tips which I found in large quantities in the similar topics about image quality and jasperreports. If we tell about my problem, I'll want to know why when I put a small image with scale option "real size" in the large input area, I can't see a small image in PDF in a good quality. For my point of view the image are scaled a little bit in the output document as PDF, but when I setup "real size" option, I hope that it would have never happened. That is why I ask about workaround how to fix it. – ZaptoS Mar 20 '16 at 21:05
  • We need to see some files that show this problem. Please include the PDF, the image file and the JRXML. It would be great if you could put together a small example which would demonstrate that the quality of your image degrades when we export it to PDF. – Teodor Danciu Jun 17 '16 at 11:42