Automatically print incoming PDF files from a hot folder
In this document we will explain how to create a File Processor channel that monitors a folder, often called a hot folder. Incoming PDF documents will automatically be printed without human intervention.
1. Add a channel
If you have never used the File Processor, and connect for the first time, there will be no File Processor channels.
We will learn how to create a new File Processor channel.
For simplicity we will use the term "channel" instead of "File Processor channel".
- Start the File Processor client
- Connect to the File Processor service
-
Go to [Options]
-
Select [File Processors] to see the overview of all file processors.
-
Click the [Add File Processor] button to create and add a new File Processor.
Now you should see a dialog to configure your channel which we will configure in a next step. Adding a new File Processor Channel is child's play.
2. Configure the channel
We will configure the channel so that the input looks for a folder. We will add a filter to only select and process PDF files and as an output we will print.
When adding a new channel you will see this:
General
here you can define a title and description. When you have many channels configured, you will be happy with this extra information.
The [Is disabled?] checkbox can enable or disable a channel. When disabled it will not monitor and thus not process any files.
Schedule
This is the place where you configure when the channel should monitor. Set it to periodic scheduling with an interval of 10 seconds.
Input
Here we define which location we want to monitor. This can be a network folder, mailbox, FTP, ...
For now we will select [Local/Network] to monitor a folder. Click the [Browse...] button and select a location. This is the so called 'hot folder' that we will monitor.
Note that this is a folder on the pc or server where the File Processor service is running! Remember that the File Processor client is an application that connects to the service. In most cases this service is running on a server. That is why you will see only directories which are visible and accessible on the server.
Input Filter
Optionally we can filter the incoming files. In this example we will create a filter to only process .pdf files.
- Click the [+] button to add a new filter
- Set the filter type to [Property] and add it
-
Select [File Name] and [MatchRegex], because we will use a regular expression (regex) to filter out the files. (More info on regular expressions)
-
Fill in this regex:
.*[.]pdf
By clicking the Pencil icon, you can test and edit your regular expression.
Conversion
In this example we will not do any conversions.
Output
In the Output section we will configure our printer, so that our PDF documents are automatically printed from a folder.
For this example we will use [Print] type to print our PDF files. This is similar of how we configured the Input.
The only thing we need to do is selecting the correct printer. In this example we will print to the Print&Share virtual printer.
Your result should be similar to this:
Post-Action
Post-Actions define what should happen with the input data after a file is processed. This is separated in two lists: what should happen with the original input file after a successful processing or after a failed processing.
Post-Actions can be methods or dataprocessors. A dataprocessor can be an Output again. This allows creating complex workflows.
For now we will use the default and delete the original file from the input directory, otherwise we would have an endless loop of processing the same file(s) again.
Final steps
After clicking [OK] to close the channel we will now have our first File Processor channel.
To edit your file processor select it in the overview and click the pencil icon.
Now we can go to our main view, the File Processor overview, by clicking [File Processors] in the ribbon:
3. Testing
We have our first channel now, let's test what we've configured!
- Make sure you are connected to the service
- Go to the configured Input directory (e.g. C:\Incoming Orders)
- Paste a PDF file in the directory (e.g. myorder.pdf).
-
Click [Start] to start the monitoring process. Each (enabled) configured channel will now monitor for files according to its defined schedule.
If all is fine, you should see activity in your File Processor channel and your PDF file should be printed automatically to your configured printer.