You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Namrata <na...@lntinfotech.com> on 2007/05/02 13:13:46 UTC

Reducing the size of SVG file

I have exported the JFreeChart as SVG using batik. And that JFreeChart is
embedded in a Jasper Report. But when i export the report as PDF the size of
the PDF file is too much becuase of the size of the charts. So can anyone
help me with how to reduce the size of SVG containing the chart? Please
reply as soon as possible.
-- 
View this message in context: http://www.nabble.com/Reducing-the-size-of-SVG-file-tf3679961.html#a10284039
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Reducing the size of SVG file

Posted by Namrata <na...@lntinfotech.com>.
i can not print the chart directly as jasper report doesnt support this data
type. So in JFreeChart we export the chart as svg, so that we can embed this
svg to jasper report. Also this Jasper report i am exporting as a PDF file.
This PDF file is one generated by client. So we can not tell him to use
acrobat features for reducing the file size. And he wants the reduced file
size when generated.


Andreas Neumann wrote:
> 
> ok, from your example it looks like you are not printing vector data, 
> but raster data. The interesting part (the chart) seems to be encoded in 
> a raster. Then, depending on the output resolution, the PDF can 
> therefore get quite large. That does not necessarily mean that the 
> vector version would be smaller. It really depends on the data density. 
> However, if the data is in raster anyway it would be probably better to 
> bypass Batik and print directly to PDF?
> 
> Also, PDF has different compression options. Your file might get much 
> smaller if you use a different compression scheme. If you own Acrobat 
> you can try the "reduce filesize" option. Other tools might have similar 
> options.
> 
> Andreas
> 
> Namrata wrote:
>> The size of each chart is approximately 20k. And the SVG contains the
>> following :
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
>> 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
>> <svg xmlns:xlink="http://www.w3.org/1999/xlink" style="fill-opacity:1;
>> color-rendering:auto; color-interpolation:auto; text-rendering:auto;
>> stroke:black; stroke-linecap:square; stroke-miterlimit:10;
>> shape-rendering:auto; stroke-opacity:1; fill:black;
>> stroke-dasharray:none;
>> font-weight:normal; stroke-width:1; font-family:&apos;sansserif&apos;;
>> font-style:normal; stroke-linejoin:miter; font-size:12;
>> stroke-dashoffset:0;
>> image-rendering:auto;" xmlns="http://www.w3.org/2000/svg">
>>   <!--Generated by the Batik Graphics2D SVG Generator-->
>>   <defs id="genericDefs" />
>>   <g>
>>     <defs id="defs1">
>>       <clipPath clipPathUnits="userSpaceOnUse" id="clipPath1">
>>         <path d="M0 0 L300 0 L300 74 L0 74 L0 0 Z" />
>>       </clipPath>
>>     </defs>
>>     <g style="fill:white; shape-rendering:crispEdges; stroke:white;">
>>       <rect x="0" y="0" width="300" style="clip-path:url(#clipPath1);
>> stroke:none;" height="74" />
>>       <image x="0" y="0" width="300"
>> xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAABKCAAAAAAkzDZaAAAArUlEQVR42u3b0QnA
>> IAwFQFM6WEbvZukKWlBKuPcv6kGEoEYNmc2FABYsWLBgwUIACxYsWLBgIYAFCxYs
>> WLAQzOdeHxJd9l4HsMazfx95Yg5l6MyCBQuWwIIFCxas1onq1/Nt6yFj/TFbdOkN
>> Sxk6s2DBgiWwYMGCBatzvlyF5YF15R+xwkcnZQgLFixYsBDAggULFixYCGDBggUL
>> FiwEsGDBggULFgJYsGDB6pkXsW8ME1/TAacAAAAASUVORK5CYII="
>> style="clip-path:url(#clipPath1);" height="74" preserveAspectRatio="none"
>> />
>>     </g>
>>   </g>
>> </svg>
>>
>> Namrata.
>>
>>
>> Namrata wrote:
>>   
>>> I have exported the JFreeChart as SVG using batik. And that JFreeChart
>>> is
>>> embedded in a Jasper Report. But when i export the report as PDF the
>>> size
>>> of the PDF file is too much becuase of the size of the charts. So can
>>> anyone help me with how to reduce the size of SVG containing the chart?
>>> Please reply as soon as possible.
>>>
>>>     
>>
>>   
> 
> 
> -- 
> --
> ----------------------------------------------
> Andreas Neumann
> Institute of Cartography
> ETH Zurich
> Wolfgang-Paulistrasse 15
> CH-8093  Zurich, Switzerland
> 
> Phone: ++41-44-633 3031, Fax: ++41-44-633 1153
> e-mail: neumann@karto.baug.ethz.ch
> www: http://www.carto.net/neumann/
> SVG.Open: http://www.svgopen.org/
> Carto.net: http://www.carto.net/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Reducing-the-size-of-SVG-file-tf3679961.html#a10318960
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Reducing the size of SVG file

Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
ok, from your example it looks like you are not printing vector data, 
but raster data. The interesting part (the chart) seems to be encoded in 
a raster. Then, depending on the output resolution, the PDF can 
therefore get quite large. That does not necessarily mean that the 
vector version would be smaller. It really depends on the data density. 
However, if the data is in raster anyway it would be probably better to 
bypass Batik and print directly to PDF?

Also, PDF has different compression options. Your file might get much 
smaller if you use a different compression scheme. If you own Acrobat 
you can try the "reduce filesize" option. Other tools might have similar 
options.

Andreas

Namrata wrote:
> The size of each chart is approximately 20k. And the SVG contains the
> following :
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
> 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
> <svg xmlns:xlink="http://www.w3.org/1999/xlink" style="fill-opacity:1;
> color-rendering:auto; color-interpolation:auto; text-rendering:auto;
> stroke:black; stroke-linecap:square; stroke-miterlimit:10;
> shape-rendering:auto; stroke-opacity:1; fill:black; stroke-dasharray:none;
> font-weight:normal; stroke-width:1; font-family:&apos;sansserif&apos;;
> font-style:normal; stroke-linejoin:miter; font-size:12; stroke-dashoffset:0;
> image-rendering:auto;" xmlns="http://www.w3.org/2000/svg">
>   <!--Generated by the Batik Graphics2D SVG Generator-->
>   <defs id="genericDefs" />
>   <g>
>     <defs id="defs1">
>       <clipPath clipPathUnits="userSpaceOnUse" id="clipPath1">
>         <path d="M0 0 L300 0 L300 74 L0 74 L0 0 Z" />
>       </clipPath>
>     </defs>
>     <g style="fill:white; shape-rendering:crispEdges; stroke:white;">
>       <rect x="0" y="0" width="300" style="clip-path:url(#clipPath1);
> stroke:none;" height="74" />
>       <image x="0" y="0" width="300"
> xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAABKCAAAAAAkzDZaAAAArUlEQVR42u3b0QnA
> IAwFQFM6WEbvZukKWlBKuPcv6kGEoEYNmc2FABYsWLBgwUIACxYsWLBgIYAFCxYs
> WLAQzOdeHxJd9l4HsMazfx95Yg5l6MyCBQuWwIIFCxas1onq1/Nt6yFj/TFbdOkN
> Sxk6s2DBgiWwYMGCBatzvlyF5YF15R+xwkcnZQgLFixYsBDAggULFixYCGDBggUL
> FiwEsGDBggULFgJYsGDB6pkXsW8ME1/TAacAAAAASUVORK5CYII="
> style="clip-path:url(#clipPath1);" height="74" preserveAspectRatio="none" />
>     </g>
>   </g>
> </svg>
>
> Namrata.
>
>
> Namrata wrote:
>   
>> I have exported the JFreeChart as SVG using batik. And that JFreeChart is
>> embedded in a Jasper Report. But when i export the report as PDF the size
>> of the PDF file is too much becuase of the size of the charts. So can
>> anyone help me with how to reduce the size of SVG containing the chart?
>> Please reply as soon as possible.
>>
>>     
>
>   


-- 
--
----------------------------------------------
Andreas Neumann
Institute of Cartography
ETH Zurich
Wolfgang-Paulistrasse 15
CH-8093  Zurich, Switzerland

Phone: ++41-44-633 3031, Fax: ++41-44-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Reducing the size of SVG file

Posted by th...@kodak.com.
Hi Namrata,

Namrata <na...@lntinfotech.com> wrote on 05/04/2007 07:21:03 
AM:

> The code for exporting the chart as svg :

>         // draw the chart in the SVG generator
>         chart.draw(svgGenerator, bounds);
> 
> Now can u suggest something......

    No, the problem is that 'chart.draw(...)'
is drawing an image instead of drawing lines and 
boxes.  I don't know much about JFreeChart and I
didn't see anything obvious in the JFreeChart docs
to explain why it would draw an image rather than
the shapes.

    Which is why I said:

> thomas.deweese wrote:

> >    Then you will have to ask the JFreeChart folks why it is
> > drawing an image rather than drawing the various lines/shapes
> > that make up the graph.  I think your PDF files will shrink a
> > bit and look better if you figure this out.

   The problem doesn't appear to be with Batik or
your use of Batik but rather in how JFreeChart is 
drawing the content.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Reducing the size of SVG file

Posted by Namrata <na...@lntinfotech.com>.
Hi, 
The code for exporting the chart as svg :
public static void exportChartAsSVG(OutputStream os, JFreeChart chart,
Rectangle bounds) throws IOException {
        // Get a DOMImplementation and create an XML document
        DOMImplementation domImpl =
            GenericDOMImplementation.getDOMImplementation();
        Document document = domImpl.createDocument(null, "svg", null);
        //System.out.println("rectangle width=>" + bounds.getWidth());
        //System.out.println("rectangle height=>" + bounds.getHeight());
        // Create an instance of the SVG Generator
        SVGGraphics2D svgGenerator = new SVGGraphics2D(document);

        // draw the chart in the SVG generator
        chart.draw(svgGenerator, bounds);

        // Write svg file

        Writer out = new OutputStreamWriter(os, "UTF-8");
        svgGenerator.stream(out, true  /*use css*/ );						
        
	}

Now can u suggest something......

Namrata.

thomas.deweese wrote:
> 
> Hi Namrata,
> 
> Namrata <na...@lntinfotech.com> wrote on 05/04/2007 06:43:35 
> AM:
> 
>> I have done the latter only. I mean i have called draw on a JFreeChart 
>> object with the SVGGraphics2D. And after tht :
>> OutputStream os = new ByteArrayOutputStream();
>> Writer out = new OutputStreamWriter(os, "UTF-8");
>> svgGenerator.stream(out, true  /*use css*/ ); 
> 
>    Then you will have to ask the JFreeChart folks why it is
> drawing an image rather than drawing the various lines/shapes
> that make up the graph.  I think your PDF files will shrink a
> bit and look better if you figure this out.
> 
>> 
>> Namrata.
>> 
>> thomas.deweese wrote:
>> > 
>> > Hi Namrata,
>> > 
>> >> Namrata wrote:
>> >> > 
>> >> > I have exported the JFreeChart as SVG using batik.
>> > 
>> > Namrata <na...@lntinfotech.com> wrote on 05/04/2007 
> 02:37:26 
>> > AM:
>> > 
>> >> The size of each chart is approximately 20k. And the SVG contains the
>> >> following :
>> >>       <image x="0" y="0" width="300"
>> >> xlink:href="data:image/png;base64,
>> >> iVBORw0KGgoAAAANSUhEUgAAASwAAABKCAAAAAAkzDZaAAAArUlEQVR42u3b0QnA
>> > 
>> >    It looks to me like you are not exporting the chart
>> > correctly with Batik.  The image element above contains
>> > a few simple geometric draw commands.  How are you
>> > exporting the chart to Batik?
>> > 
>> >    Are you calling paint/paintComponent on a
>> > ChartPanel?  Or are you calling draw on a JFreeChart 
>> > object with the SVGGraphics2D?  I think you want to
>> > do the latter.
>> > 
>> > 
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>> > For additional commands, e-mail: 
> batik-users-help@xmlgraphics.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context: http://www.nabble.com/Reducing-the-
>> size-of-SVG-file-tf3679961.html#a10320467
>> Sent from the Batik - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Reducing-the-size-of-SVG-file-tf3679961.html#a10320800
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Reducing the size of SVG file

Posted by th...@kodak.com.
Hi Namrata,

Namrata <na...@lntinfotech.com> wrote on 05/04/2007 06:43:35 
AM:

> I have done the latter only. I mean i have called draw on a JFreeChart 
> object with the SVGGraphics2D. And after tht :
> OutputStream os = new ByteArrayOutputStream();
> Writer out = new OutputStreamWriter(os, "UTF-8");
> svgGenerator.stream(out, true  /*use css*/ ); 

   Then you will have to ask the JFreeChart folks why it is
drawing an image rather than drawing the various lines/shapes
that make up the graph.  I think your PDF files will shrink a
bit and look better if you figure this out.

> 
> Namrata.
> 
> thomas.deweese wrote:
> > 
> > Hi Namrata,
> > 
> >> Namrata wrote:
> >> > 
> >> > I have exported the JFreeChart as SVG using batik.
> > 
> > Namrata <na...@lntinfotech.com> wrote on 05/04/2007 
02:37:26 
> > AM:
> > 
> >> The size of each chart is approximately 20k. And the SVG contains the
> >> following :
> >>       <image x="0" y="0" width="300"
> >> xlink:href="data:image/png;base64,
> >> iVBORw0KGgoAAAANSUhEUgAAASwAAABKCAAAAAAkzDZaAAAArUlEQVR42u3b0QnA
> > 
> >    It looks to me like you are not exporting the chart
> > correctly with Batik.  The image element above contains
> > a few simple geometric draw commands.  How are you
> > exporting the chart to Batik?
> > 
> >    Are you calling paint/paintComponent on a
> > ChartPanel?  Or are you calling draw on a JFreeChart 
> > object with the SVGGraphics2D?  I think you want to
> > do the latter.
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: 
batik-users-help@xmlgraphics.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Reducing-the-
> size-of-SVG-file-tf3679961.html#a10320467
> Sent from the Batik - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Reducing the size of SVG file

Posted by Namrata <na...@lntinfotech.com>.
I have done the latter only. I mean i have called draw on a JFreeChart 
object with the SVGGraphics2D. And after tht :
OutputStream os = new ByteArrayOutputStream();
Writer out = new OutputStreamWriter(os, "UTF-8");
svgGenerator.stream(out, true  /*use css*/ );	

Namrata.

thomas.deweese wrote:
> 
> Hi Namrata,
> 
>> Namrata wrote:
>> > 
>> > I have exported the JFreeChart as SVG using batik.
> 
> Namrata <na...@lntinfotech.com> wrote on 05/04/2007 02:37:26 
> AM:
> 
>> The size of each chart is approximately 20k. And the SVG contains the
>> following :
>>       <image x="0" y="0" width="300"
>> xlink:href="data:image/png;base64,
>> iVBORw0KGgoAAAANSUhEUgAAASwAAABKCAAAAAAkzDZaAAAArUlEQVR42u3b0QnA
> 
>    It looks to me like you are not exporting the chart
> correctly with Batik.  The image element above contains
> a few simple geometric draw commands.  How are you
> exporting the chart to Batik?
> 
>    Are you calling paint/paintComponent on a
> ChartPanel?  Or are you calling draw on a JFreeChart 
> object with the SVGGraphics2D?  I think you want to
> do the latter.
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Reducing-the-size-of-SVG-file-tf3679961.html#a10320467
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Reducing the size of SVG file

Posted by th...@kodak.com.
Hi Namrata,

> Namrata wrote:
> > 
> > I have exported the JFreeChart as SVG using batik.

Namrata <na...@lntinfotech.com> wrote on 05/04/2007 02:37:26 
AM:

> The size of each chart is approximately 20k. And the SVG contains the
> following :
>       <image x="0" y="0" width="300"
> xlink:href="data:image/png;base64,
> iVBORw0KGgoAAAANSUhEUgAAASwAAABKCAAAAAAkzDZaAAAArUlEQVR42u3b0QnA

   It looks to me like you are not exporting the chart
correctly with Batik.  The image element above contains
a few simple geometric draw commands.  How are you
exporting the chart to Batik?

   Are you calling paint/paintComponent on a
ChartPanel?  Or are you calling draw on a JFreeChart 
object with the SVGGraphics2D?  I think you want to
do the latter.
 

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Reducing the size of SVG file

Posted by Namrata <na...@lntinfotech.com>.
The size of each chart is approximately 20k. And the SVG contains the
following :
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
<svg xmlns:xlink="http://www.w3.org/1999/xlink" style="fill-opacity:1;
color-rendering:auto; color-interpolation:auto; text-rendering:auto;
stroke:black; stroke-linecap:square; stroke-miterlimit:10;
shape-rendering:auto; stroke-opacity:1; fill:black; stroke-dasharray:none;
font-weight:normal; stroke-width:1; font-family:&apos;sansserif&apos;;
font-style:normal; stroke-linejoin:miter; font-size:12; stroke-dashoffset:0;
image-rendering:auto;" xmlns="http://www.w3.org/2000/svg">
  <!--Generated by the Batik Graphics2D SVG Generator-->
  <defs id="genericDefs" />
  <g>
    <defs id="defs1">
      <clipPath clipPathUnits="userSpaceOnUse" id="clipPath1">
        <path d="M0 0 L300 0 L300 74 L0 74 L0 0 Z" />
      </clipPath>
    </defs>
    <g style="fill:white; shape-rendering:crispEdges; stroke:white;">
      <rect x="0" y="0" width="300" style="clip-path:url(#clipPath1);
stroke:none;" height="74" />
      <image x="0" y="0" width="300"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAABKCAAAAAAkzDZaAAAArUlEQVR42u3b0QnA
IAwFQFM6WEbvZukKWlBKuPcv6kGEoEYNmc2FABYsWLBgwUIACxYsWLBgIYAFCxYs
WLAQzOdeHxJd9l4HsMazfx95Yg5l6MyCBQuWwIIFCxas1onq1/Nt6yFj/TFbdOkN
Sxk6s2DBgiWwYMGCBatzvlyF5YF15R+xwkcnZQgLFixYsBDAggULFixYCGDBggUL
FiwEsGDBggULFgJYsGDB6pkXsW8ME1/TAacAAAAASUVORK5CYII="
style="clip-path:url(#clipPath1);" height="74" preserveAspectRatio="none" />
    </g>
  </g>
</svg>

Namrata.


Namrata wrote:
> 
> I have exported the JFreeChart as SVG using batik. And that JFreeChart is
> embedded in a Jasper Report. But when i export the report as PDF the size
> of the PDF file is too much becuase of the size of the charts. So can
> anyone help me with how to reduce the size of SVG containing the chart?
> Please reply as soon as possible.
> 

-- 
View this message in context: http://www.nabble.com/Reducing-the-size-of-SVG-file-tf3679961.html#a10317651
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Reducing the size of SVG file

Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
yes, it would be really good to have a look at the source of such an SVG 
chart. Quite often, the conversion tools do a bad job and can be much 
optimized. Depending on the source we might be able to do suggestions 
for improvements.

Andreas

thomas.deweese@kodak.com wrote:
> Hi Namrata,
>
> Namrata <na...@lntinfotech.com> wrote on 05/03/2007 06:44:19 
> AM:
>
>   
>> The chart contains the useful informatiion and its the bar charts 
>>     
> containing
>   
>> the information about some biomedical parameters. Firstly i created the
>> JFreeChart and then using batik i exported that chart as SVG to improve 
>>     
> its
>   
>> quality.
>>     
>
>   Have you looked at the SVG generated?  Is the SVG lots of path
> commands or one big image element?  Does the text look like text or
> is also just paths (you should be able to search and find the
> text from the chart in the SVG).
>
>   What does a text element look like in the SVG?  (I don't care
> about the actual text just the text element and it's attributes
> as well as sub elements like 'tspan').
>
>   

-- 
--
----------------------------------------------
Andreas Neumann
Institute of Cartography
ETH Zurich
Wolfgang-Paulistrasse 15
CH-8093  Zurich, Switzerland

Phone: ++41-44-633 3031, Fax: ++41-44-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Reducing the size of SVG file

Posted by th...@kodak.com.
Hi Namrata,

Namrata <na...@lntinfotech.com> wrote on 05/03/2007 06:44:19 
AM:

> The chart contains the useful informatiion and its the bar charts 
containing
> the information about some biomedical parameters. Firstly i created the
> JFreeChart and then using batik i exported that chart as SVG to improve 
its
> quality.

  Have you looked at the SVG generated?  Is the SVG lots of path
commands or one big image element?  Does the text look like text or
is also just paths (you should be able to search and find the
text from the chart in the SVG).

  What does a text element look like in the SVG?  (I don't care
about the actual text just the text element and it's attributes
as well as sub elements like 'tspan').

> And then we Export the jasper report as PDF. Now the size of the 
generated 
> PDF file is so large because we are embedding each chart as a subreport 
in 
> Jrxml. And each main report (PDF) contains many such charts (many 
subreports) 
> depending on the bio medical parameters it has. Now can u help me with 
this?

   Well I might be able to help a little based on the above info,
but so far it sounds like the only reason your final report is large
is because it has lots of charts in it.  Can you estimate the size
of each chart?  Approx how many bars in each chart? How much text
in each chart?

   If we are talking 10K per chart that sounds pretty good to me,
100K per chart would make sense for a complex chart, 1Mb/chart 
probably indicates that something is 'inefficient' in the 
PDF generation, 10MB/chart means something is wrong.

> 
> thomas.deweese wrote:
> > 
> > Hi Namrata,
> > 
> > Namrata <na...@lntinfotech.com> wrote on 05/02/2007 
07:13:46 
> > AM:
> > 
> >> I have exported the JFreeChart as SVG using batik. And that 
JFreeChart 
> > is
> >> embedded in a Jasper Report. But when i export the report as PDF the 
> > size of
> >> the PDF file is too much becuase of the size of the charts. So can 
> > anyone
> >> help me with how to reduce the size of SVG containing the chart? 
Please
> >> reply as soon as possible.
> > 
> >    Do you have any idea why the charts are so large?  What do the 
charts
> > have in them? We don't have a magical, I want smaller output option,
> > the large files are generally large for a reason.  The real question
> > is can you work around the cause or live without what ever is causing
> > it.  Without knowing the details of how you are exporting the SVG
> > (perhaps a sample SVG file) and how you are rendering the SVG to PDF
> > it's very difficult to help you.
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: 
batik-users-help@xmlgraphics.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Reducing-the-
> size-of-SVG-file-tf3679961.html#a10302444
> Sent from the Batik - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Reducing the size of SVG file

Posted by Namrata <na...@lntinfotech.com>.
Hi Thomas,
The chart contains the useful informatiion and its the bar charts containing
the information about some biomedical parameters. Firstly i created the
JFreeChart and then using batik i exported that chart as SVG to improve its
quality. It returns an inputStream. Then we save this input Stream in the
database as the binaryStream. And after tht using a query in jrxml file we
retrive this binary stream and render it in jrxml. And then we Export the
jasper report as PDF. Now the size of the generated PDF file is so large
because we are embedding each chart as a subreport in Jrxml. And each main
report (PDF) contains many such charts (many subreports) depending on the
bio medical parameters it has. Now can u help me with this?

thomas.deweese wrote:
> 
> Hi Namrata,
> 
> Namrata <na...@lntinfotech.com> wrote on 05/02/2007 07:13:46 
> AM:
> 
>> I have exported the JFreeChart as SVG using batik. And that JFreeChart 
> is
>> embedded in a Jasper Report. But when i export the report as PDF the 
> size of
>> the PDF file is too much becuase of the size of the charts. So can 
> anyone
>> help me with how to reduce the size of SVG containing the chart? Please
>> reply as soon as possible.
> 
>    Do you have any idea why the charts are so large?  What do the charts
> have in them? We don't have a magical, I want smaller output option,
> the large files are generally large for a reason.  The real question
> is can you work around the cause or live without what ever is causing
> it.  Without knowing the details of how you are exporting the SVG
> (perhaps a sample SVG file) and how you are rendering the SVG to PDF
> it's very difficult to help you.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Reducing-the-size-of-SVG-file-tf3679961.html#a10302444
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Reducing the size of SVG file

Posted by th...@kodak.com.
Hi Namrata,

Namrata <na...@lntinfotech.com> wrote on 05/02/2007 07:13:46 
AM:

> I have exported the JFreeChart as SVG using batik. And that JFreeChart 
is
> embedded in a Jasper Report. But when i export the report as PDF the 
size of
> the PDF file is too much becuase of the size of the charts. So can 
anyone
> help me with how to reduce the size of SVG containing the chart? Please
> reply as soon as possible.

   Do you have any idea why the charts are so large?  What do the charts
have in them? We don't have a magical, I want smaller output option,
the large files are generally large for a reason.  The real question
is can you work around the cause or live without what ever is causing
it.  Without knowing the details of how you are exporting the SVG
(perhaps a sample SVG file) and how you are rendering the SVG to PDF
it's very difficult to help you.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org