views:

57

answers:

3

We have a java web application. The application generates a big image with company structure diagramm on it as jpeg. Users download the image and want to print it on DIN A2 (big paper format). The jpeg in this scale has pretty bad quality after printing.

Our idea is to generate an image in vector graphics. What vector graphics format suits the best our needs, considering that we code in java and the users have windows and use MS IE browser?

May be there is a better way archieve this? Like let the browser to display the image and let users to print the page?

+1  A: 

PDF has been invented exactly for the same purpose. iText library enables you to draw lines, boxes, circles and insert whatever text you like. If you want to automate it a bit using templates there's JasperReports which utilizes iText.

Boris Pavlović
+1  A: 

A well known vector graphics format is Scalable Vector Graphics. It's basically an XML file (starting with <svg> tag. It can be viewed in browsers like Firefox without additional plugins.

For java, you can use the Java 2D API to create SVG format. A tutorial can be found here:

The Elite Gentleman
I think the Apache Batik library is the preferred solution for rendering SVG graphics in Java: http://xmlgraphics.apache.org/batik/
echo-flow
@echo-flow. Thanks for the info. I knew that there had to be an Apache library somewhere but I didn't know what it was. :-)
The Elite Gentleman
+1  A: 

If you need the vector graphic for IE you need VML, similar to SVG but can be rendered by Internet Explorer.

RaphaelJS can be used for vector graphics independent of browser model but it's client side and you may not want to do client side processing on every page load.

Alin Purcaru
thanks, nice tip
iimuhin