The results log file is the XML file representation of the PNConversionItem returned when calling ConvertFile, ConvertFileList, ConvertFolder and the XML file representation of the PNCombineItem when calling CombineFiles.

This file is always created when a file fails to convert. The name of the results log file is based on the name of the original file and also indicates the conversion status. For example, a failed conversion results file for SampleDocument.pdf would be named SampleDocument.pdf.failed.dcsresults.

If a file has failed to convert, the default behavior when converting files, file lists and folder of files is to create a .failed folder in the same location as the source file. When combining files the .failed folder is created in the save location.

The conversion results log file is then saved in the .failed folder under a new subfolder created using the date and time of the conversion. This subfolder is created to keep subsequent runs separate and can be disabled.

 

Saving The Results Files in a Different Location

The location of these files can be customized and the use of the date and time named subfolder turned off with the following custom settings:

FailedFolder

UseDateTimeInFailedFolder

 

The code sample below shows how to override the default use of the date time folder under the .failed folder and to provide a specific folder in which to store the failed results log files.

 

IList<PNConversionItem> results = new List<PNConversionItem>();

String strOutputFolder = @"C:\Test\Output";

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

 

// Directory must exist

if ( !Directory.Exists(strOutputFolder) )

{

    Directory.CreateDirectory(strOutputFolder);

}

 

// Store .failed.dcsresults files in this folder

customSettings["FailedFolder"] = @"C:\Test\FailedFiles";

 

// DO NOT store results log files in date time folder under C:\Test\FailedFiles

customSettings["UseDateTimeInFailedFolder"] = "False";

 

// Convert the folder

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

                                       true, // include subfolders

                                       "*.*", // filter

                                       "*.tif|*.jpg|*.bmp", // exclude filter

                                       strOutputFolder, // 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);

 

Disable Creation of Failed Results Files

You can disable the creation of the conversion results log files with the setting KeepFailedItemResultsFiles. When this is set to false, the .failed.dcsresults files and the .failed folder will not be created, even when conversion does not succeed.

 

IList<PNConversionItem> results = new List<PNConversionItem>();

String strOutputFolder = @"C:\Test\Output";

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

 

// Directory must exist

if ( !Directory.Exists(strOutputFolder) )

{

    Directory.CreateDirectory(strOutputFolder);

}

 

// Set this to False to discard failed results log files

customSettings["KeepFailedItemResultsFiles"] = "False";

 

// Convert the folder

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

                                       true, // include subfolders

                                       "*.*", // filter

                                       "*.tif|*.jpg|*.bmp", // exclude filter

                                       strOutputFolder, // 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);