> For the complete documentation index, see [llms.txt](https://help.pixfizz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.pixfizz.com/products-and-design/how-to-create-templates/pdf-layers.md).

# PDF Layers

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

```markup
<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.

**Update: Ability to fulfill PDF layer to a separate page within the same PDF file**

* We’ve had support for fulfilling PDF layers to a separate file for a while now. You instruct layer to fulfill to a separate file by specifying `separate-file="true"` on the `<layer>` definition.
* Now you can set up a layer to fulfill to a separate page in the same PDF file by specifying `separate-page="true"`.
* When using `separate-page="true"`, the layer is fulfilled to pages that are appended to the back of the PDF file.
* For example, if you have a 3-page product that fulfills to a 3-page PDF, and you add a layer with `name="Foil"` and `separate-page="true"`, the product will now fulfill to a 6-page PDF where the first three page represent the base layer, and the last 3 represent the “Foil” layer.

**Update: Ability to skip pages when fulfilling a PDF layer to a separate file or page**

* By default when you set up a PDF layer that fulfills to a separate file or page, every page in the product is fulfilled to the separate layer, even pages that don’t contain any elements from that layer.
* For example, if you have a 3-page product and you define a `<layer name="Foil" separate-file="true"/>`, the project will fulfill to two 3-page PDFs. If only the first page contains foil elements, the last two pages in the fulfilled PDF representing the foil layer will be blank.
* You can now specify the layers that should fulfill as separate pages/files on each `<page>` element in the template definition with `separate-layers="..."`.
* If the page should not generate any separate layers, you can set `separate-layers=""`.

**\*\*\*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.**
