You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Thorsten Weiler <th...@gmx.de> on 2001/06/27 10:38:42 UTC

Re: Sizing SVG..last try?

I'm very sorry but this does not work either. Within the svg-element width
and height determines the area the graphic may use and viewBox determines the
size of the graphic, right?
Example:
       <fo:block>some text...
         <fo:instream-foreign-object>
           <svg xmlns="http://www.w3.org/2000/svg" width="60" height="20"
viewBox="0 0 125 125" xml:space="preserve">            
             <rect x="0" y="0" width="125" height="125" style="fill:yellow"
/>
             <path style="fill:red" d="M 75,10 L 25,60 L 125,60 z"/>
             <text x="10" y="20" style="font-size:18;
font-family:Verdana">Stretch to fit</text>
           </svg>
         </fo:instream-foreign-object>
         with an image between...
      </fo:block>

But instead of scaling the graphic into the available area of 60 x 20 pixels
I only see the upper right corner of the graphic, 60 x 20 pixels
respectively.

What's wrong?

So, here is my last call for any hints or solutions. Maybe you could send me
an example that works.

Thanks a lot!

Thorsten.
> Okay, I got it wrong.
> You need to put the view box on an svg element and that works for me.
> 
> The point is though, if it works for batik it will work for svg in fop.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
> 

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

--
GMX Tipp:

Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1!
http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Sizing SVG..last try?

Posted by Thomas Kübler <t....@update.de>.
hallo keiron

i use svg and fop to produce printingcards. i tried different method to see
an svg <fo:instream-foreign-object>. the best result was to use a
fo:block-container
with very large width and height. When you put there to small values you
will see nothing.
on the otherhand i use in the svg-tag a transform-method. I think your
svg-pictures is to
big for the fo:block, so it will be cut.

for example:

<fo:block-container position='absolute' border-color='black'
border-style='solid' border-width='1pt'>
  <xsl:attribute name="width"><xsl:value-of select="$bogenbreite +
60"/>mm</xsl:attribute>
  <xsl:attribute name="height"><xsl:value-of select="$bogenhoehe +
60"/>mm</xsl:attribute>
  <xsl:attribute name="top">0mm</xsl:attribute>
  <xsl:attribute name="left">0mm</xsl:attribute>

  <fo:instream-foreign-object>
<svg:svg xml:space="preserve" width="6.45669in" height="4.76598in"
viewBox="-3229 0 6457 4766">
 <svg:defs>
  <svg:style type="text/css">
   <![CDATA[
    .str2 {stroke:#1F1A17;stroke-width:1}
    .str1 {stroke:#1F1A17;stroke-width:1}
    .str0 {stroke:#1F1A17;stroke-width:1}
    .fil0 {fill:none}
    .fil1 {fill:#1F1A17}
    .fil2 {fill:#DA251D}
 .fnt0 {font-weight:normal;font-size:110;font-family:'Helvetica'}
   ]]>
  </svg:style>
 </svg:defs>


 <svg:g id="Ebene-2" transform="translate(233 5) scale(0.07175)">
  <svg:g id="Ebene 1">
  <svg:path class="fil0 str0" d="M-2914 157l0 -157"/>
  <svg:path class="fil0 str0" d="M2913 157l0 -157"/>
  <svg:path class="fil0 str0" d="M-3071 315l-158 0"/>
  <svg:path class="fil0 str0" d="M3228 315l-158 0"/>
  <svg:path class="fil0 str0" d="M-3071 4449l-158 0"/>
  <svg:path class="fil0 str0" d="M3228 4449l-158 0"/>
  <svg:path class="fil0 str0" d="M-2914 4755l0 -158"/>
  <svg:path class="fil0 str0" d="M2913 4766l0 -158"/>
 </svg:g>

</svg:svg>
</fo:instream-foreign-object>
</fo:block-container>


thomas kübler



----- Original Message -----
From: "Keiron Liddle" <ke...@aftexsw.com>
To: <fo...@xml.apache.org>
Sent: Wednesday, June 27, 2001 11:01 AM
Subject: Re: Sizing SVG..last try?


>
> It seems to have a problem with the viewBox on the top level.#
>
> Try putting it on an svg element below the top level.
>
> On Wed, 27 Jun 2001 10:38:42 Thorsten Weiler wrote:
> > I'm very sorry but this does not work either. Within the svg-element
> > width
> > and height determines the area the graphic may use and viewBox
determines
> > the
> > size of the graphic, right?
> > Example:
> >        <fo:block>some text...
> >          <fo:instream-foreign-object>
> >            <svg xmlns="http://www.w3.org/2000/svg" width="60"
height="20"
> > viewBox="0 0 125 125" xml:space="preserve">
> >              <rect x="0" y="0" width="125" height="125"
> > style="fill:yellow"
> > />
> >              <path style="fill:red" d="M 75,10 L 25,60 L 125,60 z"/>
> >              <text x="10" y="20" style="font-size:18;
> > font-family:Verdana">Stretch to fit</text>
> >            </svg>
> >          </fo:instream-foreign-object>
> >          with an image between...
> >       </fo:block>
> >
> > But instead of scaling the graphic into the available area of 60 x 20
> > pixels
> > I only see the upper right corner of the graphic, 60 x 20 pixels
> > respectively.
> >
> > What's wrong?
> >
> > So, here is my last call for any hints or solutions. Maybe you could
send
> > me
> > an example that works.
> >
> > Thanks a lot!
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Sizing SVG..last try?

Posted by Keiron Liddle <ke...@aftexsw.com>.
It seems to have a problem with the viewBox on the top level.#

Try putting it on an svg element below the top level.

On Wed, 27 Jun 2001 10:38:42 Thorsten Weiler wrote:
> I'm very sorry but this does not work either. Within the svg-element
> width
> and height determines the area the graphic may use and viewBox determines
> the
> size of the graphic, right?
> Example:
>        <fo:block>some text...
>          <fo:instream-foreign-object>
>            <svg xmlns="http://www.w3.org/2000/svg" width="60" height="20"
> viewBox="0 0 125 125" xml:space="preserve">            
>              <rect x="0" y="0" width="125" height="125"
> style="fill:yellow"
> />
>              <path style="fill:red" d="M 75,10 L 25,60 L 125,60 z"/>
>              <text x="10" y="20" style="font-size:18;
> font-family:Verdana">Stretch to fit</text>
>            </svg>
>          </fo:instream-foreign-object>
>          with an image between...
>       </fo:block>
> 
> But instead of scaling the graphic into the available area of 60 x 20
> pixels
> I only see the upper right corner of the graphic, 60 x 20 pixels
> respectively.
> 
> What's wrong?
> 
> So, here is my last call for any hints or solutions. Maybe you could send
> me
> an example that works.
> 
> Thanks a lot!
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org