PDF Layers

You can generate multi-layer PDF documents using the XSL-FO z-index attribute as a layer ID. To convert all XSL-FO elements with a fixed z-index value to a PDF layer, use the <altsoft:z-index-to-layer-assignment> tag inside the XSF-FO declarations section.



<!ELEMENT z-index-to-layer-assignment EMPTY>
<!ATTLIST z-index-to-layer-assignment
   z-index-level CDATA #REQUIRED
   level-name CDATA #REQUIRED
   show-state (true|false) #IMPLIED>

z-index-level - the layer number defining all layer objects via the XSL-FO z-index property;
level-name - the layer name to be used by the Acrobat Layers panel;
show-state - initial state of the layer. Use the true value if you want it to be visible (printable) and false if vise versa. Possible values:

  • true - the layer is visible for both print and view (default)
  • false - the layer is invisible for print and view
  • view:[true|false];print:[true|false] - separate settings for view and print

This tag must be the first level descendant of the <fo:declarations> element.

For example, to create a layer from all objects having z-level="101", use the following declaration:

   <fo:declarations xmlns:altsoft="http://alt-soft.com/xml2pdf/extensions">
       show-state="false" />

Altsoft Xml2PDF formatting engine supports z-index attribute in <fo:block-container> and <fo:inline-container> elements:

   <fo:inline-container z-index="10">
     <fo:block>Albert Einstein</fo:block>