What Output Options are there for Production?

Breaking changes

  • output="vector" is now deprecated and will be removed in the future, use output="pdf" instead.

  • output="vector-singlepage" no longer works, use output="pdf" with output-single-pages="true" instead.

  • The filename="..." parameter in template XML is deprecated and will be removed in the future, use output-filename="..." instead.

Settings precedence

There are four main settings that control how a project gets fulfilled:

  • the format (pdf, jpeg, png)

  • filename template

  • whether project should always be fulfilled to files with single pages, even when using formats that support multiple pages in one file (ie. PDF)

  • whether to output multiple copies of the file for cut prints that have a quantity > 1 (by default a single file is generated and you need to look at the job ticket to determine how many copies you should print)

The defaults for these four settings can be set on the fulfillment setting in the super admin. All four of them can also be overridden on specific templates, by using the following attributes on the <definition> element in template XML:

  • output (value should be “pdf”, “jpeg”, or “png”)

  • output-filename (the filename template; supports liquid)

  • output-single-pages (whether to output each page as a separate file — ignored unless fulfilling to PDF; supported values are “true” and “false”)

  • output-multiple-copies (whether to create multiple copies of prints that have a quantity > 1 — ignored if fulfilling to multi-page PDF; supported values are “true” and “false”)

Notable updates

Liquid support for filename templates

Liquid is now supported in filename templates.

These top-level variables are available in the template:

  • order

  • orderline

  • user

  • project

  • website

  • format - the chosen output file format (one of: “pdf”, “jpeg”, “png”)

  • idx - a counter that starts at 1 and gets incremented for each generated file (equivalent to %idx)

  • page_output_name - this is the equivalent to %type% (”cover”, “pages1”, “pages2”)

  • layer_output_name - when outputting layers to separate files, this variable contains either the output-name attribute of the layer, or the value of the name attribute if no output-name is explicitly defined.

Old-style escapes are still supported, but cannot be mixed with liquid (you can use either liquid or the escape codes, but not both in the same filename template).

These escapes are supported:

  • %prod_code%

  • %order_code%

  • %barcode%

  • %type%

  • %quantity%

  • %idx%

  • .%format%

Fulfilling to subfolders

Filename templates now support subfolders. If you want to put files into a subfolder, prefix the filename with the desired folder name. This is supported in both liquid and old-style filename templates.

Example of a static folder:

files/%barcode%-%idx%.%format%

Example of a dynamic folder name where files go into a folder whose name is constructed from the product code and the barcode

{{ project.product.code }}-{{ orderline.barcode }}/{{ idx }}.{{ format }}

Custom page output names

By default files are still split into cover (if our algorithm determines that the book has a cover) and pagesN, but it is now possible to override that behaviour in the template definition. To do that, add output-name to at least one <page> in the template definition.

The default splitting algorithm puts the cover (if it exists) into a separate file, and then creates a new pagesN file each time it gets to a page with a different dimension.

When using explicit output-names it becomes your responsibility to use different values for the output-name if you want the page to get output to a separate file.

Among other things, output-name makes it possible to:

  • Put the cover into a separate file even if it has the same size as the rest of the pages (our default algorithm would fail to detect this page as a cover).

  • Put pages of different sizes into the same PDF.

The value of output-name is available in liquid filename templates as {{ page_output_name }} and as %type% when using old-style filename templates.

Layer output names

When using PDF Layers that you output as separate files, liquid filenames and old-style filenames work a bit differently.

With old-style filenames, the layer output name is always appended as _<layer-name> right before the extension.

For example if you are using a filename template %barcode%-%idx%.%format%, and a layer named Cutmarks that is marked with separate-file="true", the file with the layer will be named %barcode%-%idx%_Cutmarks.%format%.

When using liquid filenames, the filename is not automatic. You have to make sure to use {{ layer_output_name }} in the template. To replicate the filename above, you would have to use this filename template: {{ orderline.barcode }}-{{ idx }}{% if layer_output_name %}_{{ layer_output_name }}{% endif %}.{{ format }}.

Last updated