When converting a folder of files or a list of files it is important to remember that these files can be processed in parallel, meaning that multiple files can be converted at the same time. This needs to be taken into consideration with folders and list of files to avoid name collisions and accidental overwrites of created files in the output folders.

The number of files that can be converted in parallel is firstly controlled by Document Conversion Service, up to the limits of its license model. Secondly, the PEERNET.ConvertUtility also submits the documents to the Document Conversion Service on parallel threads. The number of documents submitted is automatically determined based on the number of CPU's and cores on your system multiplied by two.

We recommend that you allow this value to be determined automatically for best performance. If you do need to customize how many documents you submit to Document Conversion Service in parallel, the conversion setting NumberOfDocumentsInParallel can be passed as additional user settings to control how many parallel threads the PEERNET.ConvertUtility uses.

Please note that this only applies to the ConvertFolder and ConvertFileList methods where you are processing multiple files.

 

PNConversionItem resultItem = null;

 

// Add the number of threads

Dictionary<String, String> customSettings = new Dictionary<String, String>();

customSettings[ "NumberOfDocumentsInParallel" ] = "6";

 

resultItem = PNConverter.ConvertFolder(@"C:\Test\InputFiles",

                                       true, // include subfolders

                                       "*.pdf", // filter

                                       String.Empty, // exclude filter

                                       @"C:\Test\Output", // output folder

                                       true, // overwrite existing

                                       false, // remove file ext

                                       false, // create log

                                       "TIFF 200dpi OptimizedColor", // settings

                                       String.Empty, // extensison profile

                                       String.Empty, // MIME profile

                                       customSettings, // User settings

                                       String.Empty, // not using remote conversion (DCOM)

                                       String.Empty, // use default working folder

                                       String.Empty);