General
In this article we will explain how you can automatically print files from a hotfolder, but change the printer properties based on a filename.
Let's say that we have these 3 files:
order4546-c.pdf
order54787-m.pdf
invoice-c.pdf
Each filename contains a letter c
or m
.
Every file ending with c
should be printed in color. The files containing m
should be printed in monochrome/black&white.
Another common scenario are the number of copies, specified in the filename or the papersize, like: pickinglist-A3-2.pdf
where A3
could be the paper size and 2
the number of copies.
For the brevity of this article, we will focus on configuring a single printer property, e.g. color, but configuration for the other printer properties is similar and uses the same methods.
Configuration
- Create a new channel
- Schedule: Detect files automatically.
- Input: set the input type to Local/Network and select the folder to monitor.
- Output: set the output type to Print.
Leave the other options and settings default.
We have now have a basic channel that monitors files from a folder and automatically prints them.
Now we will configure the Print-Output:
- Enable the checkbox for the Color setting.
- Set the default-value to Monochrome.
A default settings will be used when a recognition does not match.
- Click on the arrows-button to configure the dynamic property.
- Select the Enable recognition for: Color checkbox.
- Choose property: File name, because the color indication is in our file name.
- We will use a regular expression (regex) to filter out the letters
c
andm
from the file name.
Click Add and select option Regex and click OK.
- For the Regular Expression use this value:
(?i).*[-](c|m)[.]pdf
and use Group 1 as Result to use.
This takes the letterc
orm
that we can use in our lookup.
- Click Add and select option Lookup.
- In the Lookup click on Add item. For the first column add
c
and as result select Color. - Now do the same but for letter
m
by adding a new entry in the lookup for Monochrome.
- Click OK to close all dialogs.
Testing
Now Start the File Processor, and see how your files are being printed. If you configured correctly, all PDF documents ending with c
will be printed in color, the ones ending with m
will be printed in monochrome/black&white.