Dynamic pdf names per document from XML

Hi 'm struggling to create seperate PDF files from a XML file, using metadata found on a node,
error message I recieve:
16:19:08.201 [0018] W3001 : Error while executing plugin: HTTP/1.1 500 LoggedApplicationException: There was an error running the output creation process caused by ApplicationException: New file tries to overwrite file created in this run ‘C:\Users\ol-admin\Connect\filestore\7396.7846260096997994420\16082018.pdf’

In the output directoy it creates during the create print content a txt file with the outputname as set in the Job outpumask in the output presets.

If I run a XML with only 1 document it works perfect, but with multiple documents I keep running into above error. The correct PDF files are created in the mentioned folder with the correct names. But not in the folder set.

Any help much appreciated

Sounds like you’ve got your Output set to split by document, right?

Check your output file mask. If the names aren’t unique per document, you’ll see that error. It doesn’t want to overwrite a file it just made, though it’ll happily overwrite a file from a previous run.

Take a look here, for instance: PReS Connect 2018.2 User Guide

You could do something like time stamping, though this can be problematic for very fast templates. Or you can use ${file.nr} which will add an incremental sequence number into the file name. Or if you’ve got some value from your data that’s guaranteed unique, consider that. A customer ID may appear several times in a set of documents for example, so that may not be a great choice. But maybe a combination of things like custID, invoiceID, and issue date?