[xep-support] external-graphic problem

G. Ken Holman gkholman at CraneSoftwrights.com
Wed Aug 8 05:58:52 PDT 2007


At 2007-08-06 18:29 +0200, Mati Hadi wrote:
>I n my xsl-fo I use external-graphic to display
>different images. The images have unknown size. When
>the image is big enough, everything is ok, but when
>the image is small, I want the image in the output pdf
>become small. I wonder if there is a way to put i.e.
>max width to 120mm and max height to 170mm, so that
>the images are scaled to 120mm and 170mm, depending on
>their size.
>My code is:
>                   <fo:table-row>
>                      <fo:table-cell
>text-align="center" number-columns-spanned="3
>height="242mm" display-align="center">
>                         <fo:block>
>                            <fo:external-graphic
>src="url({$Framsida.Bild})"
>content-width="scale-to-fit" width="70mm"/>
>                         </fo:block>
>                      </fo:table-cell>
>                   </fo:table-row>
>Thank you and regards
>Matilda

An XSL-FO 1.0 solution is possible but it involves the use of the 
max-height= and max-width= properties.  XEP maps max-height/max-width 
to height/width, as stated in A.1.2. Formatting Properties Supported 
by XEP - 7.14.6 max-height, of the XEP User Guide (see notes 10 and 
11), and so it does not work.

I have an example page sequence below that works when max-height= and 
max-width= are available.  In the example below harbourbig.jpg is 
very large, smflags.gif is very small, and itway.gif is of medium size.

I hope this is helpful, though I realize it doesn't get you the 
desired behaviour.

. . . . . . . . . . . . . . Ken

<page-sequence master-reference="frame"
                xmlns="http://www.w3.org/1999/XSL/Format">

<flow flow-name="frame-body">

   <block>
     <external-graphic src="url('harbourbig.jpg')"/>
   </block>

   <block>
     <external-graphic src="url('harbourbig.jpg')"
       max-width="120mm" max-height="170mm"
       content-height="scale-to-fit" content-width="scale-to-fit"
       scaling="uniform"/>
   </block>

   <block>
   &lt;block>
     &lt;external-graphic src="url('harbourbig.jpg')"
       max-width="120mm" max-height="170mm"
       content-height="scale-to-fit" content-width="scale-to-fit"
       scaling="uniform"/>
   &lt;/block>
   </block>

   <block>
     <external-graphic src="url('smflags.gif')"
       max-width="120mm" max-height="170mm"
       content-height="scale-to-fit" content-width="scale-to-fit"
       scaling="uniform"/>
   </block>

   <block>
   &lt;block>
     &lt;external-graphic src="url('smflags.gif')"
       max-width="120mm" max-height="170mm"
       content-height="scale-to-fit" content-width="scale-to-fit"
       scaling="uniform"/>
   &lt;/block>
   </block>

   <block>
     <external-graphic src="url('itway.gif')"
       max-width="120mm" max-height="170mm"
       content-height="scale-to-fit" content-width="scale-to-fit"
       scaling="uniform"/>
   </block>

   <block>
   &lt;block>
     &lt;external-graphic src="url('itway.gif')"
       max-width="120mm" max-height="170mm"
       content-height="scale-to-fit" content-width="scale-to-fit"
       scaling="uniform"/>
   &lt;/block>
   </block>

</flow>
</page-sequence>


--
Upcoming public training: XSLT/XSL-FO Sep 10, UBL/code lists Oct 1
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman                 mailto:gkholman at CraneSoftwrights.com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/f/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Jul'07  http://www.CraneSoftwrights.com/f/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html



More information about the Xep-support mailing list