Microsoft Windows Service
This C# Windows Service sample creates and monitors an input folder for text files (*.txt). A timer is used to poll the input folder every 15 seconds and use the COM Interface with the chosen PEERNET printer to convert any files dropped into the folder. When the output files are created, the source files are moved from the input folder to a processed folder. A custom event log named PNSrv9Log is also added to the Windows Event Viewer and used to log messages from the service.
The sample Windows Service demonstrates how to customize the output filename on a per-file basis and how the PNSrv9 COM event OnEndJob can be used to track the list of files created.
A simple Windows forms application, PNSrv9 Sample Service Control Panel, is also included with the sample service. This forms application controls the service start-up parameters through a graphical user interface. This allows the service to be used with any of the PEERNET printers and to customize the type of file each printer creates.
Both on-line and PDF documentation, as well as sample code are available from the menu to the left.
The following applications and services must be installed:
- One or more of the following PEERNET printers must be installed. The printer can be in trial mode. The printer used will determine the type of output file created and can be chosen dynamically when the sample is run.
- Raster Image Printer 9.0.001 or later, available here.
- TIFF Image Printer 9.0.001 or later, available here.
- PDF Image Printer 9.0.001 or later, available here.
- Microsoft .NET Framework 2.0 or higher must be installed as the sample application targets .NET 2.0.
- Administrative privileges are required to install and remove services.
- Either Notepad or WordPad must be set as the default application for opening text (*.txt) files.
A zip file containing the sample can be downloaded here. The download contains a setup program to install the application. You do not need Visual Studio 2008 to run the sample but it is required if you want to compile and edit the sample.