axf:layer-settings

(Auszug aus "XSL-FO ― Die Referenz" von 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

Category Layer in PDF Output

Defines layers. V6.3[no-LT]

Value: none | <layer-setting> [, <layer-setting>]*
Initial: none
Applies to: root element
Inherited: no
Percentages: N/A

Values have the following meanings.

none No definition.
<layer-setting> <layer-setting> has the following syntax:
<layer-setting> = <layer-name> [on | off]? [ view [on | off] || print [on | off] || export [on | off] || locked || lang<string>prefered? ]?
<layer-name> = <string>
Multiple layers can be defined by comma-separated items. <layer-name>, the name which identifies a layer is indispensable with the definition of the layer. Others are omissible. on|off specify the default state of a layer. When omitted, it is considered as on. It is also possible to specify the default state of on/off for every feature of view, print, and export. When locked is specified the layer will be locked. lang specifies the language.

This property is not available with AH Formatter V6.3 Lite.

XSL-FO sample:

<fo:root xml:lang="en" axf:layer-settings="layer1,layer2,layer3,layer4 view off,layer5 view on print off,layer6,layer7,layer8 view on lang en locked on" 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">

Antenna House, Inc.

Layer in PDF output

PDF layer can be specified by axf:layer-settings and axf:layer. Specify the layer setting like axf:layer-settings="layer1,layer2" in fo:root and specifies in which layer the area is specified like axf:layer="layer1". The features which can be specified are view, print, export, locked and lang. The initial state of on/off can be specified to view, print and export. locked locks a layer. lang specifies a language. The layer settings are effective only with PDF 1.5 or later. In this sample, <axf:document-info name="pagemode" value="UseOC" /> is specified so that the layer pannel can be shown when opening the document.

Example of layer setting

Example of defining layre1, layre2, layre3 and arranging the layer to fo:block-container.

layer1

layer2

layer3

Example of defining layer4 by [layer4 view off] and hiding the layer as default.

layer4

Example of defining layer5 by [layer5 view on print off] and showing the layer but hiding it when printing.

layer5

Example of defining layer6, defining layer7 to the arranged fo:block in fo:block-container and arranging it. If layer6 is hidden, then layer7 can also be hidden.

layer6 (fo:block-container)

layer7 (fo:block)

Example of defining layer8 by [layer8 view on lang en locked on], speciying Englsin as the language, specifying the layer to be locked.

layer8

</fo:flow>

</fo:root>

Download der Beispiele

Output:

Tipp der data2type-Redaktion:
Zum Thema XSL-FO bieten wir auch folgende Schulungen zur Vertiefung und professionellen Fortbildung an: