Auto-print C# Sample

 

Description:

The Auto-print sample provides developers with a framework for creating automated batch printing or document conversion solutions either with or without user interaction. The Auto-print technology can be used with Black Ice printer drivers. 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 sample, please see the Configuring the Auto-print C# Sample. For redistributing the Auto-print sample, please see the necessary files in Redistribution files of the Auto-print C# Sample section. For more information about how to use and track the processed documents, please refer to the Using the Auto-print C# Sample section.

 

By using Auto-print technology, an application can automatically print commonly used documents types without any user interaction. The Auto-print sample comes with a simple, effective and easy to use interface to demonstrate the basic features and possibilities.

 

 

 

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.

Profile:

Applies a predefined profile for the document conversion. For more information about the available profiles in the Black Ice Printer Drivers, please see the Predefined Profiles section.

NOTE: 32-bit Auto-print samples cannot load profiles from 64-bit Black Ice Printer Drivers installed on 64-bit operating systems.

PDF Converter Settings:

Select the application to use for PDF printing. The Auto-Print sample supports Adobe Reader 10 or higher, Adobe Acrobat Pro 10 or higher and Foxit Reader 9.6 or higher.

If both applications are available, ‘Use Adobe Reader to print PDF files’ option is selected by default.

NOTE: To print PDF documents, Adobe Reader 10 or higher, Adobe Acrobat Pro 10 or higher or Foxit Reader 9.6 or higher has to be installed on the computer; otherwise PDF printing is not possible.

 

 

 

If one is using file monitory on the Converted (Output) folder, the file monitoring system event is triggered as soon as the file is created in the Converted (Output) folder. This could create a problem, since the conversion is not finished and the writing of the file is not finished, therefore the monitoring will fail. We created a new option below to avoid this problem.

 

If the option of ‘If one is monitoring the “Converted (Output) folder”, use a temporary directory for the converted files’ is checked, the Auto-print sample will create a temporary folder ([Processed folder]\Temp). During the conversion process, the printer driver will write the file into the [Processed folder]\Temp folder. Once the printer driver finished converting every page of the document, the Auto-print sample will move the output file to the Converted (Output) folder.

 

NOTE: when specifying the Input, Converted, Processed, Failed directories and Log file, environment variables are also can be used.

 

Developers:

The Auto-print samples use the BiAutoPrint.dll or ActiveX control.

 

System Requirements:

Windows 11 / 10 / 8 / 7

Windows Server 2022 / 2019 / 2016 / 2012  or Citrix Server

 

Save As window, Open Output folder and Group file generation restrictions

The Auto-print samples does not allow Save As window pop up during the conversion, Open Output Feature, and Group file generation even if it’s configured in the Black Ice Printer Driver used for conversion.

 

Advanced error handling and Spooler restart

Auto-print samples are including advanced error handling which attempts to restart the spooler service on the system if it’s stops working during the conversion. In order to use advanced error handling, make sure that the Auto-print sample is running As Administrator.

 

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\C#\Auto Print C# Sample

 

Solution files

Compilers

Target .NET Framework

Auto Print CS Sample_VS2005.sln

Visual Studio 2005

.NET Framework 2.0

Auto Print CS Sample_VS2010.sln

Visual Studio 2010

.NET Framework 4.0

Auto Print CS Sample_VS2012.sln

Visual Studio 2012

.NET Framework 4.0

Auto Print CS Sample_VS2013.sln

Visual Studio 2013

.NET Framework 4.0

Auto Print CS 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 C# Sample\bin\Debug\

 

Release:

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