SwiftConvert+DirMon Conversion Quick-Start Guide

DirMon is a Directory Monitor, "hot folders" NT service designed specifically for use with SwiftConvert and SwiftPublish.  DirMon automates conversions by monitoring a specified directory for incoming documents, and runs a command when a file is present.  DirMon is included with the purchase of an application server license of SwiftConvert or SwiftPublish.

Installation and Default Configuration

Use of the SwiftConvert Directory Monitor (DirMon) requires either an evaluation or a licensed copy of SwiftConvert.  For an evaluation, please refer to the SwiftConvert Product Page.  In addition to installing SwiftConvert, you must also install DirMon for SwiftConvert (currently a component of SwiftPublish).

Installing DirMon creates an NT service, titled “SwiftView Tools”, which monitors multiple directories for conversion.  By default, the DirMon installer adds 7 directories into the C:\Program Files\Swiftview directory:


Once the DirMon component is installed, you can copy or move a PCL file to c:\program files\swiftview\converttopdf and collect the converted PDF file in c:\program files\swiftview\convertout.

When a file is placed into the converttopdf directory, DirMon waits until the file is fully written, then moves it to the converttopdfwork directory and begins to perform the conversion.  You can drop multiple files into the convertopdf directory, and DirMon will properly queue them.  Once a file is converted, DirMon creates an output file in the convertout directory with the same name as the original input file, but with a .pdf suffix.  The working copy is then deleted and the same process is repeated. 

The converttotiff directory works the same way, but creates a .tiff file.

Advanced Configuration

All of DirMon’s configuration is done using registry entries.  The entries are located in HKEY_LOCAL_MACHINE\SOFTWARE\SwiftView .  A dirmonX directory is added for each set of entries, where X is a a number listed in consecutive order without skipping any numbers.

The testlicense directory simply triggers a check of SwiftConvert licensing under the DirMon service login. Each registry directory contains 4 different entries:
command – Contains the actual command line passed to SwiftConvert
indir – The full path of the input directory to monitor
outdir – The full path of the output directory for the converted file
workdir – The full path of the working directory, where the file is temporarily stored while being converted
savedir – The full path of an optional directory, where the input file is left after conversion

DirMon can be configured to monitor more directories then the default.  To do this you will need to add additional registry directory sets.  The easiest way is to create a registry file to add the entries.

An initial .reg file called dirmon.reg is placed in c:\program files\swiftview, to help you configure more directories.  The reg file contains the registry entries for the default directories:


"label"="Convert To PDF"
"indir"="c:\\program files\\swiftview\\converttopdf"
"outdir"="c:\\program files\\swiftview\\convertout"
"workdir"="c:\\program files\\swiftview\\converttopdfwork"
"command"="c:\\program files\\swiftview\\sview -v1 -c\"set service on|ldoc \"\"%in\"\"|
                   save PDF all \"\"%outdir\\%inbase.pdf\"\" onefile|set quotechar ^|
                   set onexit \"\"unlink ^$docname()^\"\""

"label"="Convert To Tiff"
"indir"="c:\\program files\\swiftview\\converttotiff"
"outdir"="c:\\program files\\swiftview\\convertout"
"workdir"="c:\\program files\\swiftview\\converttotiffwork"
"command"="c:\\program files\\swiftview\\sview -v1 -c\"set service on|ldoc \"\"%in\"\"|
                   save TF_G4 all \"\"%outdir\\%inbase.pdf\"\" onefile|set quotechar ^|
                   set onexit \"\"unlink ^$docname()^\"\""

To create additional directories, copy one of the above entries and add additional dirmonX entries.  Each registry set must contain command, indir, outdir, and workdir entries.  Here is an example of another entry that would add a third set of monitored directories to convert to PDF:

"command"="c:\\program files\\swiftview\\sview -v1 -c\"set service on|ldoc \"\"%in\"\"|
                   save PDF all \"\"%outdir\\%inbase.pdf\"\" onefile|set quotechar ^|
                   set onexit \"\"unlink ^$docname()^\"\""

The above example would add the directories c:\converttopdf, c:\convertout, and c:\convertopdfwork .  When adding more monitored directories, make sure the entries are sequential without missing any numbers: dirmon1, dirmon2, dirmon3, etc.  If any numbers are missing, the subsequent entries will not be seen.

Integration Notes
When integrating DirMon into your process, there are a few details you should keep in mind.

All errors during directory monitor operation are logged in the Windows Event Viewer.  Open Control Panel...Adminstrative Tools...Event Viewer...Application.  Errors are displayed in console error dialogs in an evaluation install, but this should be disabled for production by unchecking the "Display Errors" option in the DirMon configuration screen. Error display by printing applications depends on DirMon running under the Local System user, see below.

Users and Permissions
DirMon is an NT service named "SwiftView Tools".  It runs under a Log On user account you select at installation, which you can subsequently change from the Control Panel...Adminstrative Tools...Services...SwiftView Tools...right-click...Properties screen.  The Log On user should always be a member of the Adminstrators group.  When initially testing DirMon operation, login as Local System is recommended.  If you find problems accessing resources such as network filesystems, try changing to a real user with network access.

You should check that any conversion application run under SwiftPublish can be started by that user without displaying any dialogs.  Drag a file onto a printer icon to check.

If customizing your own monitored directories you must make sure the SwiftView Tools service user has write access to the monitored directories.  This issue can come up if you are monitoring a directory on a network file server, whether that directory is in a drive location mapped for that user (e.g. "f:\"), or accessed using the full UNC path ("\\hostname\\directory"). 

Input/Output Directories
Each monitored directory set has an input, working, and output directory, but it is possible to share some of these locations among the sets.  In the default configuration, DirMon has separate input and working directories for each type of conversion, however always outputs to the same directory.

You can use the same working and output directory for multiple sets. 

Depending on your setup, you may want to separate some of the directories and share others.  If you were developing an archiving system, for example, this may be useful.  If the users that are creating the initial file have restricted access to directories, it could be necessary to have multiple input directories, each accessible by a user.  Once the files are in the users input directory, the directory monitor could use the same working and output directories since it would have different access restrictions then the user.  The result would be users placing files in individual directories, but all files converted and outputted to the same location.

Advanced ICS Commands
If you are familiar with SwiftView's ICS commands, you will see that the "command" value of the registry entries simply contains a command line call to SwiftConvert with conversion ICS commands and environment variables used to specify the document name.  This command string can also be edited to add markup, text extraction, or other ICS commands that you may want to use for conversion.  Dealing with doubly-embedded quotes can be tricky, so please contact tech support if you want to add additional commands to the conversion process.

Technical Details
For more details on installing and configuring DirMon, see the Directory Monitor External Specification

SwiftView®, SwiftConvert, SwiftStamp, SwiftExtract, SwiftReprint, SwiftPublish, and LoanDocs®, are trademarks of eLynx
SwiftView, a division of Black Knight Financial Services, 9205 SW Gemini Drive Beaverton, OR 97008 USA
800.720.0196 or +1.971.223.2600
  ©2017 Black Knight Financial Services.