XML technologies / XSL-FO / Reference / Attributes in XSL-FO / scaling

(Excerpt from "XSL-FO ― Die Referenz" by Manuel Montero Pineda & Steffen Herkert, 2016, dpunkt.verlag)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Recommendation section: 7.15.12

Category: 7.15 Area Dimension Properties

Description

When an object or graphic is included using <fo:external-graphic> or <fo:instream-foreign-object>, its height can be set with content-height and its width with content-width. The scaling attribute determines whether its proportions are preserved. With the default value (uniform), only a height or a width is needed; the missing dimension is calculated. If both are supplied, the width takes priority. The scaling attribute can also allow the object to be distorted to match the specified height and width.

Values

uniform

This value preserves the proportions of the graphic.

non-uniform

This value allows the graphic to be distorted.

Inherited:

yes

Default value: uniform

XSL-FO version: 1.0

Allowed in:

<fo:external-graphic>

This element inserts external graphics into the document. Attributes provide numerous configuration options.

<fo:instream-foreign-object>

This element allows inline graphics or other inline objects to be inserted into the document.

Support:

Conformance level

Antenna House

FOP

RenderX XEP

Altsoft XML2PDF

Compart DocBridge

Extended

Y

Y

Y

Y

Y

XSL-FO example:

<fo:root font-family="Arial" font-size="10pt" line-height="1.2em" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:cpfo="http://www.compart.net/xmlns/cpfo" xmlns:svg="http://www.w3.org/2000/svg" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
<fo:layout-master-set>
<fo:simple-page-master master-name="Inhalt-Seiten" margin="0mm 0mm 0mm
                      0mm" page-height="150mm" page-width="148mm">
<fo:region-body margin="10mm 15mm 10mm
                        25mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Inhalt-Seiten" font-size="10pt">
<fo:flow flow-name="xsl-region-body">
<fo:block-container margin-bottom="2em">
<fo:block>
<fo:external-graphic src="data2type-logo.TIF" content-height="100%" scaling="uniform"/>
</fo:block>
<fo:block>
scaling="uniform"
</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="2em">
<fo:block>
<fo:external-graphic src="data2type-logo.TIF" content-height="100%" content-width="25%" scaling="uniform"/>
</fo:block>
<fo:block>
scaling="uniform"
</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="2em">
<fo:block>
<fo:external-graphic src="data2type-logo.TIF" content-height="100%" content-width="25%" scaling="non-uniform"/>
</fo:block>
<fo:block>
scaling="non-uniform"
</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="2em">
<fo:block>
<fo:external-graphic src="data2type-logo.TIF" content-height="25%" content-width="100%" scaling="non-uniform"/>
</fo:block>
<fo:block>
scaling="non-uniform"
</fo:block>
</fo:block-container>
</fo:flow>
</fo:page-sequence>
</fo:root>

Download the examples

In the output:

Excerpt from the W3C Recommendation:

More information online about

Rendering of the property in the XSL-FO reference

back to top