xsl-list
[Top] [All Lists]

Re: [xsl] XSL-FO: How to Control Rendered Size of InStream SVG?

2014-07-27 10:16:43
Follow up: It looks like with the width and height set on the SVG element
to match the original, then the units in the SVG canvas align with points,
such that this produces the expected result:

<svg:svg version="1.1" id="Layer_1" xmlns:svg="http://www.w3.org/2000/svg";
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px" width="7in"
height="10pt"
          xml:space="preserve">
      <svg:polygon fill="#9A9A9A" points="9.8,0 504,0 504,10 0,10 "/>
  </svg:svg>


That is, a pointed polygon 504 points (7 inches) long and 10 points high.

Again, this is an SVG produced by Illustrator, which appears to use a 1
pixel = 1 point space, at least by default.

Cheers,

E.
—————
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com




On 7/27/14, 9:36 AM, "Eliot Kimber ekimber(_at_)contrext(_dot_)com"
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

That was the hint I needed.

It turns out that the key appears to be specifying @width and @height on
the <svg> element. This markup gives me the result I wanted: a 7in x 9pt
rectangle:

<fo:block margin-top="2pc">
           <fo:instream-foreign-object
             >
 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg";
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px" width="7in"
height="9pt"
        xml:space="preserve">
 <rect x="0" y="0" fill="#009A9A" width="100%" height="100%"/>
 </svg>
           </fo:instream-foreign-object>
         </fo:block>

Cheers,

E.


—————
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com




On 7/27/14, 3:16 AM, "jfrm(_dot_)maurel(_at_)gmail(_dot_)com 
jfrm(_dot_)maurel(_at_)gmail(_dot_)com"
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

Le 26/07/2014 22:38, Eliot Kimber ekimber(_at_)contrext(_dot_)com a écrit :

Hi,

Any guidance on what I need to adjust to control the size of the
rendered
SVG to my desires?

Maybe:

http://xmlgraphics.apache.org/fop/1.1/graphics.html#svg-scaling

Regards

-- 
Jean-François MAUREL
PIMECA
http://www.pimeca.com




--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>