best output for pdf? (itext)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Phillip Rhodes

best output for pdf? (itext)

Post by Phillip Rhodes » Wed Aug 28, 2002 3:22 am

I have created some nifty charts with jfreechart. But when I include them as a jpeg into itext, they don't match the rest of the font quality. I know I can directly use the lower-level api's that would give me a better quality, but as I am using the itext xml -> pdf, this would be kind of hard to implement.

Can someone give me an order of what is the best quality in terms of image resolution and quality is for the different outputs.
I see jpeg is better than gif, but what about svg, or png?

Thanks,
Phillip

David Gilbert

Re: best output for pdf? (itext)

Post by David Gilbert » Wed Aug 28, 2002 7:03 am

PNG is better than JPEG for charts, since it uses a "lossless" compression algorithm...you get back exactly your original image (JPEG introduces a few artefacts).

When I include images in the JFreeChart documentation, I use PNG and scale the size down by a factor of 2, 3 or 4. This looks OK on screen (plus you can zoom to 200%, 300% or 400% to see the original screen resolution), and results in better resolution when the images are printed (at least on the printers I have tried).

I haven't tried getting SVG into PDF yet, but if it can be done then I expect it would give the best results.

If anyone else has some tips, I'd love to hear them as I use PDF quite a lot...

Regards,

DG.

Sam Whitfield

Re: best output for pdf? (itext)

Post by Sam Whitfield » Fri Aug 30, 2002 12:35 am

You mention that you make a PNG image and then scale it down to put it into the PDF.

What is the best way to do this? I have tried several and my image quality is still not good enough.


Thanks

Sam

David Gilbert

Re: best output for pdf? (itext)

Post by David Gilbert » Fri Aug 30, 2002 8:00 am

Hi Sam,

I use pdflatex on Linux to create the PDF documentation for JFreeChart. To include an image scaled to half size, I use:

\scalebox{0.5}{\includegraphics{images/pie.png}}

For larger PNG images, I'll change the scale factor to 0.33 or 0.25. This has the advantage that the image will be reproduced perfectly on-screen when the document magnification is 200%, 300% or 400% (depending on the scale factor).

At normal viewing magnification, the quality is not perfect, but acceptable for me. Printing appears better (at least on my setup) for the larger images that have been scaled down the most, I presume because Acrobat printing makes use of the extra resolution from the larger image.

Regards,

DG

Locked