xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samuel Remacle" <srema...@hotmail.com>
Subject RE: Resizing SVG
Date Wed, 27 Jul 2005 09:00:32 GMT
<html><div style='background-color:'><DIV class=RTE>
<P>My picture isn't an external graphic, it's an instream foreign object so I have to
use&nbsp;the preserveAspectRatio attribute? And if I resize the whole svg document but
I keep the same size for the differents elements (rectangles, circles, etc.) it doesn't matter?
They will be resized?</P>
<P>Thanks for your answers</P>
<P>Samuel<BR><BR>&gt;From: "Pascal Sancho" &lt;pascal.sancho@takoma.fr&gt;<BR>&gt;Reply-To:
fop-users@xmlgraphics.apache.org<BR>&gt;To: &lt;fop-users@xmlgraphics.apache.org&gt;<BR>&gt;Subject:
RE: Resizing SVG<BR>&gt;Date: Wed, 27 Jul 2005 09:54:20 +0200<BR>&gt;<BR>&gt;Hi,<BR>&gt;<BR>&gt;You
cannot resize your picture directly if it is an external graphic (in FOP 0.20.5, scaling is
not supported -- see [1])<BR>&gt;<BR>&gt;However, you can try this (I
have never experimented it -- take care with namespaces):<BR>&gt;<BR>&gt;1.
In your xslt, refer to your SVG document, using the document() XSLT function<BR>&gt;2.
make a fo:instream-foreign-object as the SVG container<BR>&gt;3. transform your
SVG xml as follows:<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; - change width
and height attribute of the svg:svg element.<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;
- if needed (that should be), add both viewbox and 
preserveAspectRatio attributes to your svg:svg element.<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;
- copy the whole rest of xml<BR>&gt;<BR>&gt;Good luck (if you try it,
please feed back)<BR>&gt;<BR>&gt;[1] http://xml.apache.org/fop/compliance.html#fo-property-scaling<BR>&gt;<BR>&gt;Pascal<BR>&gt;<BR>&gt;<BR>&gt;&nbsp;&nbsp;
_____<BR>&gt;<BR>&gt; De : Samuel Remacle [mailto:sremacle@hotmail.com]<BR>&gt;
Envoyé : mardi 26 juillet 2005 22:57<BR>&gt;<BR>&gt; I'm not sure you
understood my problem, the SVG should be bigger in my application than in the PDF, so as it
will be first viexed in the application, I need to resize it in the XSL-FO file, and I need
to keep the proportions.<BR>&gt;<BR>&gt; So I'd like to no if there's
a way to do that, does anyone know?<BR>&gt;<BR>&gt; &gt;From: "J.Pietschmann"
&lt;j3322ptm@yahoo.de&gt;<BR>&gt; &gt;<BR>&gt; &gt;Samuel
Remacle wrote:<BR>&gt; &gt;&gt;application is 
ok. But after when I generate a PDF file from my<BR>&gt; &gt;&gt;application
the SVG image is too big for an A4 document. So I'd<BR>&gt; &gt;&gt;like
to know if there's a way to resize my SVG image keeping the<BR>&gt; &gt;&gt;proportions.<BR>&gt;
&gt;<BR>&gt; &gt;Generate your SVG with a width and heigth attribute on
your to level<BR>&gt; &gt;svg:svg element, both in either cm, in or pt but not
in pixel (no<BR>&gt; &gt;measurement unit). The height and width should represent
the actual<BR>&gt; &gt;measurements in the PDF. Use the same heigth and width
on the<BR>&gt; &gt;fo:external-graphic or fo:instream-foreign-object in the
FO source.<BR>&gt;<BR>&gt;<BR></P></DIV></div></html>

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

View raw message