Auto-print Service C# Sample

 

The Auto-print service sample demonstrates automated batch printing of document conversion solutions without user interaction from Windows services. The Auto-print Service technology can be only used with Black Ice printer drivers. The Auto-print API can be executed on Windows 2025/2022/2019/2016/2012 services to convert documents and image files. Please refer to the Supported Document Type section to see the supported file formats to convert.

 

To see the detailed instructions on how to configure the Service C# sample, please see the Configuring the Auto-print Service C# Sample. For redistributing the Auto-print Service sample, please see the necessary files in Auto-print Service C# Redistribution files section. For more information about how to use and track the processed documents, please refer to the Using the Auto-print Service C# Sample section.

 

cid:image001.png@01D73506.7504E550

 

Service Properties:

 

To install and use the Auto-print C# Service, please enter the credentials of an administrative user (please do not use System account).

 

Benefits of document conversion running as service:

The Auto-print service can run unattended under "Administrator" account instead of under a particular user. This allows the Auto-print service to continue the document conversion even after the current Administrator user is logged off.

 

The Auto-print service must run under a domain or local administrator account who already once logged in on the computer. The Auto-print service cannot run under system account.

 

Startup type: The startup type determines how the Service is run. The following startup types are available:

 

·         Automatic: the Service starts automatically with the operating system at each system startup. (default)

·         Manual: the Service must be started manually.

 

Startup delay: Defines the startup delay in seconds.

 

Install Auto-print C# Service: To install the Auto-print C# Service please click on the “Install Auto-print C# Service” button. The text, next to the button indicates that the Service is already installed or not.

 

 

 

Auto-print C# Service Printing Properties:

 

Select printer: Select the Black Ice Printer Driver to use for converting documents.

 

Input folder: Select the input directory which contains the documents need to be converted.

 

Converted (Output) folder: Specifies the path of the directory which contains the successfully converted documents. If it’s not configured, the converted documents will be saved into the Printer Driver’s output directory.

 

Processed folder: Specifies the path of the directory which contains the original documents, which were successfully processed / converted.

 

Failed folder: The files which cannot be converted will be moved into this directory.

 

Log file:  Specifies the log file’s location and name. The sample logs every printed filename with path, printing date/time, elapsing time and every occurring warnings and errors during the printing.

 

 

Fine tuning Auto-print Samples

The Auto-print C#, C++, VB.NET and Service samples timeout interval, printing delay interval and password protection checking can be configured through the BiAutoPrint.ini file for the better document conversion. For more information please refer to Fine tuning Auto-print Samples section.

 

 

Filename Generation

The Auto-print will save the printed documents in the same name as the source input document. For example, if printing 1.jpg to PDF file format, then the printed document will be named to 1.pdf.

NOTE: If there is already a file named 1.pdf, Auto-print will overwrite the existing file.

 

 

Sample Source Code Folder Location:

<Auto-print Installation Folder>\<Auto-print 32/64 bit>\Samples\Sample Source Codes\Auto Print Service C# Sample

 

Solution files

Compilers

Target .NET Framework

Auto Print Service C# Sample_VS2005.sln

Visual Studio 2005

.NET Framework 2.0

Auto Print Service C# Sample_VS2010.sln

Visual Studio 2010

.NET Framework 4.0

Auto Print Service C# Sample_VS2012.sln

Visual Studio 2012

.NET Framework 4.0

Auto Print Service C# Sample_VS2013.sln

Visual Studio 2013

.NET Framework 4.0

Auto Print Service C# Sample_VS2015.sln

Visual Studio 2015

.NET Framework 4.0

 

Output path of the built sample executable:

Debug:

            <Auto-print Installation Folder>\<Auto-print 32/64 bit>\Samples\Sample Source Codes\C#\Auto Print Multi-Threaded Service C# Sample\bin\Debug\

 

Release:

            <Auto-print Installation Folder>\<Auto-print 32/64 bit>\Samples\Sample Source Codes\C#\Auto Print Multi-Threaded Service C# Sample\bin\Release\

 

The base requirement is MS Office 2016 or 2013 or 2010 or 2007 and Adobe Reader 10 or higher or Adobe Acrobat Pro 10 or higher to be installed on the server.