You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Priscilla_ <lu...@hotmail.com> on 2012/03/23 14:09:21 UTC

Saving SVG file into PDF

Hello,
First of all, sorry for my bad English,
I would like to export my generated chart in SVG format in order to generate
a PDF using Apache FOP.
It seems my generated SVG file is not correct : when I use any other SVG
(externally downloaded) my PDF is perfect. but with the SVG generated with
Batik, just like documentation says, there's no errors but my PDF is empty.

I edited the SVG file manually and it seems that when I replace this line: 

<svg xmlns:xlink="http://www.w3.org/1999/xlink" style="fill-opacity:1;
color-rendering:auto; color-interpolation:auto; stroke:black;
text-rendering:auto; stroke-linecap:square; stroke-miterlimit:10;
stroke-opacity:1; shape-rendering:auto; fill:black; stroke-dasharray:none;
font-weight:normal; stroke-width:1; font-family:&apos;Dialog&apos;;
font-style:normal; stroke-linejoin:miter; font-size:12; stroke-dashoffset:0;
image-rendering:auto;" xmlns="http://www.w3.org/2000/svg">

with this line: 

<svg xmlns:xlink="http://www.w3.org/1999/xlink" style="fill-opacity:1;
color-rendering:auto; color-interpolation:auto; stroke:black;
text-rendering:auto; stroke-linecap:square; stroke-miterlimit:10;
stroke-opacity:1; shape-rendering:auto; fill:black; stroke-dasharray:none;
font-weight:normal; stroke-width:1; font-family:&apos;Dialog&apos;;
font-style:normal; stroke-linejoin:miter; font-size:12; stroke-dashoffset:0;
image-rendering:auto;" xmlns="http://www.w3.org/2000/svg"
width="800" height="800">

So I just add width and height clauses, and it worked fine ! 

So, I need to change that in my SVG generation, I tried to add these lines: 

svgGenerator.getRoot().setAttribute("width", "800"); 
svgGenerator.getRoot().setAttribute("height", "800"); 

But it seems that doesn't work : I tried to read the value of theses
attributes after, and these are empty. 

Is there any mean I can use to change that?
-- 
View this message in context: http://old.nabble.com/Saving-SVG-file-into-PDF-tp33544655p33544655.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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