OL Learn

How to give dynamic output names for separated PDF?

Hi,

it`s nice to have the possibility to group and split a job based on a datafield to output single pdf files.

Is it possible to name the single pdf files based on a datafield too (e.g. customer-id)?

I choose “Directory” as OutputType in the Print Output Options. In the “Job Output Mask” field is a variable called ${template}. Are there also other variables then ${template}?

Best regard,
Thomas

Hello Thomas,

Yes, it is possible to name pdf files based on a datafield.

You can create a Job Preset, check “Include meta data (PDF-VT only)”, press “Next” and, create a Document Tag with the name (e.g. PDFName), referring to one of your fields in your data model.

After that, create an Output Preset, set the Printer Model to “Generic PDF“, and check “Directory” on the Output Options. On the Job Output Mask, set to $ {document.metadata[‘PDFName’]}.pdf

Select the Separation option and set your Separation to the Document level.

I hope this has helped

Regards,

Luciano

Hello Luciano,

thanks for your help. It works. :slight_smile:

Regards,
Thomas

Me again…

since the last update I don’t have the possibility to group my record on “document” level. Now I have to group my records on “document set” level. Based on that issue it’s not further possible to use “${document.metadata[‘METADATAFIELDNAME’]}.pdf”. I get the following error:

There was an error running the output creation process caused by {0}There was an error initiating to the output creation process caused by ApplicationException: error evaluating expression ‘document.metadata[‘Country’]’ at line 1, column 3 in pattern ‘${document.metadata[‘Country’]}.pdf’
(SRV000041)
There was an error running the output creation process caused by {0}There was an error initiating to the output creation process caused by ApplicationException: error evaluating expression ‘document.metadata[‘Country’]’ at line 1, column 3 in pattern ‘${document.metadata[‘Country’]}.pdf’
(SRV000041)

My settings:

Job Presets:

  • Sorting: “Country”
  • Grouping an Splitting: Document Set Grouping Fields > “Country”
  • Meta Data Options: Document Tags > “Country” (name is also “Country”)

Output Presets:

  • Output Mask: ${document.metadata[‘Country’]}.pdf
  • Separation: Document Set (I tried it as well with “Document”)
  • PDF Type: PDF-VT

I think I have to set the meta tag name on document set level and change the output mask. But what should I type in the Output Mask? ${documentset.metadata[‘Country’]}.pdf didn´t work.

Regards,
Thomas