PDF Layers

Custom PDF layers (also known as “Optional Content Groups”) are defined in the template definition:

<layers>
  <layer name="Barcode" />
  <layer name="Cutmarks" visibility="fulfillment" separate-file="true" />
</layers>

The only required attribute of the <layer> element is name.

The <layer> element supports these additional attributes:

  • visibility: allowed values are on (default), off and fulfillment . The fulfillment value means that the layer is visible on files generated for production, but is toggled off in the design tool and on previews.

  • separate-file: allowed values are false (default) and true. When set to true, the layer will be fulfilled to a separate file when generating files for production.

  • filename: Ignored unless separate-file is true. When fulfilling to a separate file, the filename of the file containing the layer will by default equal “{base_name}_{layer_name}.{extension}”. For example if the main file is named pages1.pdf, and we’re using a “Cutmarks” layer as defined above, the accompanying layer file will be named pages1_Cutmarks.pdf by default. If you want to use a different file name, specify it with this attribute. If you want to fulfill multiple layers to the same PDF file, you need to give them the same filename. Standard placeholders are supported: %prod_code%, %order_code%, %barcode%.

Once the layers are defined in the template definition, you can assign elements to them using the admin design tool.

***PRO TIP: Layers can also be used to help with creting designs. Once setup they can be used as layers like you have in Photoshop, where you can toggle layer visibility on/off. This can help greatly to access elements that are on different layers.

Last updated