Innosoft PrintService
General
A tool called ISPrintService exists in the Classic Client environment. Even though it originates from the Classic environment, it is also required for modern solutions such as the Innosoft FSM or the Innosoft Mobile App.
The ISPrintService is a Windows service that checks the PRINTSERVICEJOBS table at regular intervals (configurable) for new incoming processing jobs. If a new job is found, the report stored there is filled in with specific values from the database using the parameters also transferred. The output is then converted to a PDF file, which is then processed in various ways (offered to the user for download in the browser, displayed to the user in the Innosoft Mobile App, stored in the Innosoft document manager, sent via e-mail).
These processing jobs are generated by Innosoft standard products such as the FSM or the server for the Mobile App. However, they can also be generated by customer-specific adaptations, such as triggers, interfaces, plug-in DLLs for the server module, etc.
To convert the generated reports to PDF files, a print job is sent to the "Innosoft PDF Printer". Accordingly, this must be available on the same system on which the ISPrintService is installed.
Generally, it does not matter on which server the ISPrintService is installed, as long as it can reach both the database and the output directories via the network. (With regard to the accessibility of network directories, please also refer to the following section "User configuration") A good option is to run the ISPrintService on the web server on which the Innosoft FSM and, if applicable, the AppServer for the mobile app is running.
If the service is already installed and you only want to replace the corresponding application file (ISPrintService.exe), the service must be stopped in the meantime:
Stop service
Replace ISPrintService.exe
Start service
Set up
Installation of the Innosoft PDF-Printer
If the "Innosoft PDF - Printer" has not yet been installed on the system, run the corresponding setup file "PDFPrinterSetup.exe" as administrator. No special settings/information are required during the setup. However, you will be asked once to approve the installation of the required printer driver.
Storing the program files
Select a directory on the local data carrier that is to serve as the program directory for the ISPrintService. It is recommended that this is a directory outside of C:\Program Files or C:\Program Files (x86). It is also recommended to use a separate directory for the ISPrintService files only. For example, select C:\Innosoft\Bin\ISPrintService\.
Unpack the ISPrintService installation package into this directory.
Configuring the ISPrintService.ini configuration file
You will now find the configuration file ISPrintService.ini in the program directory. Open this with a text editor, for example Windows Notepad.
There are only a few settings that you need to change. These are explained below.
All possible settings are listed in the supplied ISPrintService.ini and described with explanatory comments.
If you make changes to ISPrintService.ini during operation, the service does not need to be restarted. The program reads the settings from the file each time before checking the database for newly received processing jobs.
Required settings
ConnectionString / ConnectionStringEncrypted
One of the mandatory settings is the connection to the database. You have the option of specifying a connection string in the "[CONNECTION]" section.
[CONNECTION]
; ConnectionString with clear text password
CONNECTIONSTRING=
"Provider=SQLOLEDB;Persist Security Info=True;User ID=Innosoft;Initial Catalog=Innosoft;Data Source=DatabaseServer;Password=MyCleartextPassword"
; ConnectionString with encoded password.
; If both CONNECTIONSTRING and CONNECTIONSTRINGENCRYPTED are defined, CONNECTIONSTRINGENCRYPTED will be used.
CONNECTIONSTRINGENCRYPTED=
"Provider=SQLOLEDB;Persist Security Info=True;User ID=Innosoft;Initial Catalog=Innosoft;Data Source=DatabaseServer;Password=MyEncodedPassword"
Enter the ConnectionString after the key "CONNECTIONSTRING=" if you want to specify the password in plain text.
However, if you want to enter the password in coded form, select the key "CONNECTIONSTRINGENCRYPTED=".
You can take the ConnectionString and the coded password from an already correctly configured "innosoft.xml" configuration file. If you do not have such a file, please contact your Innosoft project manager.
A database client driver must be installed on the system so that the connection to the database can be established. For example, the Microsoft OLE DB Driver is required to connect to a Microsoft SQL server. If necessary, download this from Microsoft and install it.
AllowCreateTargetDirs
In each processing job, the ISPrintService is informed in which directory and file name it should create the resulting PDF file. By default, the ISPrintService is not allowed to create directories if they do not exist.
However, both the FSM and the AppServer generate the processing jobs in such a way that each file is to be written to a separate directory specifically intended for this file. Therefore, if you use either the FSM and/or the AppServer, you must allow the ISPrintService to create directories. This is done by setting the "AllowCreateTargetDirs" key to the value "1":
[OPTIONS]
; Is the service allowed to create target folders
if
they
do
not exist? (Default:
0
)
ALLOWCREATETARGETDIRS=
1
If desired, you could use the additional key "ALLOWCREATETARGETDIRSJAILDIR=" to restrict the ISPrintService to create directories only below a specific directory. The following setting, for example, only allows this below the directory C:\Innosoft\Bin\ISPrintService\Output:
[OPTIONS]
; If the service is allowed to create target directories (see above), you may limit the creation only to folders beneath
this
directory. Which means no folders outside of
this
directory will be created. (Default:
""
)
ALLOWCREATETARGETDIRSJAILDIR=C:\Innosoft\Bin\ISPrintService\Output
TempDir
In many cases, the resulting PDF files should not be written locally, but to a network directory ("UNC path").
In such cases, the ISPrintService tells the Innosoft PDF printer to print the file directly to this location by default. However, this can lead to problems regarding missing access rights, which do not necessarily have to be noticeable immediately, but can also occur after some operating time.
To avoid these problems from the outset, we strongly recommend configuring a temporary print directory. This should be a directory on a local data carrier of the computer on which the ISPrintService service is running.
The PDF files are then always printed by the PDF printer to this directory first. The ISPrintService then moves the file to its actual destination.
The temporary print directory is configured in the configuration file using the "TempDir=" key. In the following example, the directory C:\Innosoft\Bin\ISPrintService\Temp is configured as the temporary print directory:
[OPTIONS]
; Instead of being directly created in the target directory, the PDFs will be created in
this
temporary directory and being copied to the target directory afterwards. This prevents potential problems with the
; PDF-Printer not being able to create PDFs in network paths.
TEMPDIR=C:\Innosoft\Bin\ISPrintService\Temp
Recommended settings
By default, errors are logged in a text file "ISPrintService.log" in the program directory.
If you would like to change the location and/or the file name of this file, use the key "FILENAME=" in the "[LOGGING]" section:
[LOGGING]
; The filename of the log file to write. If no path is prepended the file will be written to the program directory of the service.
FILENAME=C:\Innosoft\Bin\ISPrintService\Log\MyISPrintService.log
In the same section, you can also increase the logging level for error diagnostics using the "LEVEL=" key:
[LOGGING]
; Possible values: ERROR, NORMAL, DEBUG, TRACE
LOGLEVEL=DEBUG
Installing the Windows service
The installation of a new Windows service can only be carried out with a Windows account that has administrative authorizations.
The name of a Windows service must be unique. Otherwise, Windows will refuse to install an additional instance.
If this is not the first installation of an ISPrintService on this system, a unique internal name must also be provided as the display name before the additional instance is installed. This is done in ISPrintService.ini using the following keys:
[OPTIONS]
; In Windows systems, multiple instances of the same service application can only be installed
if
their service name and service display name is unique.
; Otherwise the installation will fail with a Windows error code
1072
,
1073
or
1078
.
; So
if
you want to install the Innosoft PrintService a second, third, etc. time on the same computer, specify a unique service name and service display name in the following keys.
; Do
this
before, before you
try
to install the service!
; The service name must be a single word and must not begin with a decimal number! It should also contain only ASCII characters.
; Example:
; SERVICENAME=ISPrintService_ProdEnvironment
; SERVICEDISPLAYNAME=Innosoft Print Service - Productive Environment
SERVICENAME=
SERVICEDISPLAYNAME=
If you forget this and try to install a second instance of the service under an existing name, Windows will reject this with an error code 1072, 1073 or 1078.
To install the service, the ISPrintService.exe must be executed once with the command line parameter "/install" with administrator rights.
You should already find an "install.bat" file in the program directory. Run this as an administrator (right-click → "Run as administrator").
Alternatively, you can also execute the command yourself in a DOS command prompt. Start this as an administrator (right-click → "Run as administrator"). Then execute the following command:
"C:\Innosoft\Bin\ISPrintService\ISPrintService.exe"
/install
If you have selected a program directory other than C:\Innosoft\Bin\ISPrintService, you must adapt the call accordingly.
After successful installation, you should find a new corresponding entry in the Windows services overview. The service should not yet be started:
User configuration of the Windows service
After installing the service, it is configured by default to run with the "Local system" account.
It is strongly recommended that you do not run the service with one of the "LOCAL SYSTEM", "NETWORK SERVICE" or "LOCAL SERVICE" accounts predefined in Windows!
On the one hand, these accounts cannot access network directories in principle, and on the other hand, these accounts do not have fully-fledged user profiles, as is the case for normal user accounts. For this reason, it is very likely that problems will occur when reading out the available printers or when reading out and setting the default printer. These often manifest themselves in the messages "There is no default printer currently selected" or "The printer name is invalid".
Create a new user in the Active Directory that can be used for the ISPrint service. There may already be a user who is used for other Innosoft applications. You could also use this for the ISPrintService.
Open the properties of the service, select the ‘This account’ option on the ‘Login’ tab and enter the user name and password of this user.
Save the settings with "OK".
Log on with this user at least once in an interactive Windows session on the system on which the ISPrintService is to be executed. Windows only sets up the user profile of a new user completely when it has to create a desktop for the user for the first time. Only with a fully set up user profile can the available printers and the default printer be read out without errors and configured by the ISPrintService.
In concrete terms:
If you are already logged on to the system with another user, log off.
Reconnect to the system via remote desktop or console if you are not physically present on the system.
Log in with the user name and password of the user who is to be used for the ISPrint Service.
Wait until the desktop appears.
Wait further 2-3 minutes until any background processes still running have been completed.
Log out of the system again.
Required rights / settings
Below you will find information on the settings and authorisations for a Windows user that is to be used for the ISPrintService:
No special group memberships are required. It is sufficient if the user is a member of the "Domain users" group. This is the default setting when creating new users.
As this is an account that is not normally used interactively by a user, Windows cannot actively notify the user when passwords are about to expire. You should therefore consider configuring the user so that the password never expires. Alternatively, use the ‘Managed service accounts’ option in the Active Directory.
The user must be authorised to print to the "Innosoft PDF - Printer". This is also the default setting.
Depending on the configuration or use of the system, the ISPrintService user must have both read and write authorisations for certain files and directories. It is possible that the user already has the authorisations implicitly due to their group memberships. You should check this.
Authorisations are assigned as usual in Windows. Firstly, the access control list in the file system must be configured accordingly (right-click → Properties → Security). If it is a network share (UNC directory), the authorisations in the share itself must also be granted (right-click → Properties → Share).
Specifically, authorisations are expected for the following files/directories:
Log file of the ISPrintService. By default, the ISPrintService.log in the programme directory. However, a different location/name of the file may have been configured via ISPrintService.ini.
The temporary directory in the local file system (must be a local directory specification).
The "QR output directory" configured in the FSM (is either a local or UNC directory specification).
If customer-specific triggers, interfaces, etc. also generate processing jobs in the PRINTSERVICEJOBS table: Other directories that potentially write these to PRINTSERVICEJOBS.FILENAME (either local or UNC directory specification).
The document manager base directory (most likely a UNC directory specification).
Start type "Automatic (delayed start)" of the Windows service
Immediately after a system restart (reboot), it is still very busy. It is therefore possible that network connections cannot yet be established or only with a considerable delay. In order to avoid problems when establishing the database connection, it is strongly recommended to configure the start type of the service to "Automatic (delayed start)". To do this, open the properties of the service and select the value "Automatic (Delayed start)" as the "Start type" on the "General" tab. Save the settings by clicking "OK".
Starting the Windows service
Now start the ISPrintService service. To do this, make sure that the service is selected in the Windows service administration and then select the corresponding "Start" button.
This is only necessary once or only if you want to replace the "ISPrintService.exe" programme file. The "Automatic ..." start type ensures that the service starts automatically after a system restart.
If an error message appears at startup, look in the log file "ISPrintService.log" to find out the specific error.
If no log file has been created after an error or if it does not contain any new messages, the user under which the service is running probably has no rights to write to the log file. In such a case, you will find the ISPrintService messages in the Windows Event Viewer.
However, if everything has been configured correctly, the service should now be started and will check regularly for new processing jobs.
Please refer to the relevant FSM documentation to find out how to configure the FSM so that it can also generate jobs.