A command line utility that accepts a text file containing a list of files, and/or a list of files provided on the command line, and combines all of the files together into a single file or a collection of serialized pages using Document Conversion Service. The files are appended together in the order in which they are received.

The Document Conversion Service must be running, either locally or on a remote computer for the files to be combined. If it is not running the command will return immediately with an error.

 

DCSCombineFiles /P=profile /S=save location /N=output name

                [/O] [/L] [/E=extension map]

                [/C=remote computer name;remote scratch folder]

                [/FAIL=failed results log file location] [/SIL=conversion log file path] 

                [/D="name:value"] [/W=wait time] 

                [/I=input text file path] 

                [/T=alternate temp folder]

                "file" "file" ...

 

Sample Command Lines

Combine all files on command line into a single TIFF image:

DCSCombineFiles /S="C:\Test\Output" /N="CombinedFiles" /P="TIFF 200dpi Monochrome"

                "C:\Input\File1.doc" "C:\Input2\File2.doc"

Sends the files C:\Input\File1.doc and C:\Input\File2.doc to Document Conversion Service to be converted using the settings contained in the conversion profile TIFF 200dpi Monochrome.

The converted files are saved as a single TIFF image, named CombinedFiles.tif in the output folder C:\Test\Output. The files are combined in the order in which they are returned by the underlying file system.

If an output file with the same name already exists, or if one of the files in the combine set fails to convert, the combine will fail and a results log file will be placed in a folder named .failed created in the save location. The results log file name will be "PNCombineFiles_", followed by a date and time stamp and ending with failed.dcsresults. This can be controlled with the /FAIL switch.

To overwrite an existing file the /O switch would need to be added to the above command.

 

Convert all files in the input file to a multipage PDF:

DCSCombineFiles /S="C:\Test\Output" /N="CombinedFiles"

                /P="PDF 300dpi OptimizedColor"

                /I="C:\Test\Files.txt"

Sends the files listed in the text file C:\Test\Files.txt to Document Conversion Service to be converted using the settings contained in the conversion profile PDF 300dpi OptimizedColor.

The converted files are saved as a multipaged PDF file named CombinedFiles.pdf in the output folder C:\Test\Output. The files are combined in the order they are listed in the input file.

Upon successful conversion each output file is placed under the C:\Test\Output folder.

If a file with the same name already exists, or if one of the files in the combine set fails to convert, the conversion will fail and a results log file will be placed in a folder named .failed created in the save location. Where this file is saved can be controlled with the /FAIL switch.

The results log file name starts with PNCombineFiles, contains a date and time stamp and ends with .failed.dcsresults.

 

Convert all files in the input file and command line to a multipage PDF in that order:

DCSCombineFiles /S="C:\Test\Output" /N="CombinedFiles"

                /P="PDF 300dpi OptimizedColor" /I="C:\Test\Files.txt"

                "C:\Test\EndOfCombine.doc"

Sends the files listed in the text file "C:\Test\Files.txt",  followed by the file "C:\Test\EndOfCombine.doc" specified on the command line, in that order, to Document Conversion Service to be converted using the settings contained in the conversion profile PDF 300dpi OptimizedColor.

The converted files are saved as a multipaged PDF file named CombinedFiles.pdf in the output folder C:\Test\Output. The files are combined in the order they are listed in the input file.

Upon successful conversion each output file is placed under the C:\Test\Output folder.

If a file with the same name already exists, or if one of the files in the combine set fails to convert, the combine will fail and a results log file will be placed in a folder named .failed created in the save location. Where this file is saved can be controlled with the /FAIL switch.

The results log file name starts with PNCombineFiles, contains a date and time stamp and ends with .failed.dcsresults.

 

Combine all files on command line into a single TIFF image, save conversion results logs to a specific location:

DCSCombineFiles /L /S="C:\Test\Output" /N="CombinedFiles"

                /P="TIFF 200dpi Monochrome" /FAIL="C:\Test\Output\Failed\\"

                "C:\Input\File1.doc" "C:\Input2\File2.doc"

Sends the files C:\Input\File1.doc and C:\Input\File2.doc to Document Conversion Service to be converted using the settings contained in the conversion profile TIFF 200dpi Monochrome.

The converted files are saved as single TIFF image, named CombinedFiles.tif in the output folder C:\Test\Output. The files are combined in the order given on the command line - File1.doc followed by File2.doc.

If a file with the same name already exists,  or if one of the files in the combine set fails to convert, the combine will fail and a conversion results log file will be placed into the folder C:\Test\Output\Failed.

The conversion results log file name starts with PNCombineFiles, contains a date and time stamp and ends with failed.dcsresults. You can use the /D parameter UseDateTimeInFailedFolder to remove the date and time stamp from the results log file name.

To overwrite an existing file the /O switch would need to be added to the above command.

 

Command Line Arguments

Command line switches are not case-sensitive and can be entered in either upper or lower case.

/S - The Save Location

This is a required argument. Pass in the full path to the folder in which to save the new files.

If the path includes spaces it must be enclosed in quotes.

If the path doesn't exist, the conversion will fail.

If a file of the same name already exists in the save file location, the conversion will fail. To enable file overwriting, use the /O option.

 

Example:

/S="C:\Converted Files\Test"

 

/N - Output File Name

This is a required argument and specifies the name to use for the output file. The default file extension for the type of file being created will always be added to the name provided here.

Example:

/N="CombinedOutput_06_15_2012"

 

/O - Overwrite Always

Enables overwrite mode so that existing files of the same name are overwritten with the new file. If overwrite is not specified the combine action will fail if a file of the same name already exists in the save location.

 

/L - Results Log

The results log file is an XML file containing a complete snapshot of the combine request. Normally only saved for failed conversions, the /L argument enables creation of the results log file when the conversion succeeds.

All results log files for this command line utility start with PNCombineFiles_, contain a date and time stamp and end with the conversion status.

When the combine has succeeded, the results log file is placed in the same folder as the output (specified using the /S switch) and would have a name similar to the following:

PNCombineFiles_2013_05_31_2_50_05_PM_3.succeeded.dcsresults

The bold text in the name will change for each file and is based on the date and time of the run and an internal counter. You can suppress the use of the date and time information in the file name by passing false for the UseDateTimeInFailedFolder setting using the /D switch.

In the case of a failed conversion, the log file is always created. See the /FAIL switch to control the location and creation of the failed results log files.

The result log files can later be passed to the DCSExtractResults command line utility to extract information such as all files created or any errors encountered during conversion. You can search a folder for the results log files using the DCSCreateFileList utility.

 

/FAIL - Combine Results Log File Location

In the case of a failed combine, the combine results log file is always created. When the combine does not succeed, a .failed folder is created in the save folder location (provided by the /S switch) and the results log files are stored there.

The name of the results log when the combine does not succeed will be similar to the following:

PNCombineFiles_2013_05_31_2_50_05_PM_3.failed.dcsresults

The bold text in the name will change each time a combine command is run and is based on the date and time of the run and an internal counter.

This argument allows you to override the default use of the .failed folder and to provide a specific folder in which to store the failed results log file. You can suppress the use of the date and time information in the file name by passing false for the UseDateTimeInFailedFolder setting using the /D switch.

Note: The double ending backslash used when specifying the folder for the /FAIL switch is required for the command line path to be parsed correctly.

Examples:

/FAIL="C:\ConvertedFiles\Failed\\" /D="UseDateTimeInFailedFolder:FALSE"

 

If you do not want to create the failed results log files at all, you can use the /D switch to pass the KeepFailedItemResultsFiles setting as false.

On the command line:

/D="KeepFailedItemResultsFiles:False"

 

In a conversion profile:

<add Name="KeepFailedItemResultsFiles" Value="False"/>

 

The result log files can later be passed to the DCSExtractResults command line utility to extract information such the source file used or any errors encountered during conversion. You can search a folder for the results log files using the DCSCreateFileList utility.

 

/P - Conversion Profile

This argument is required. The type of file created is controlled by supplying a conversion profile using this switch. The profiles are referenced by passing in the name of the profile XML file, with or without the XML extension. See Creating and Customizing Profiles for more information about the contents of the profiles, a list of profiles included with Document Conversion Service, and how to create your own.

Examples:

/P="TIFF 300dpi Color Fax"

/P="TIFF 204x196dpi Monochrome Fax.xml"

 

/D - Define Setting

Individual profile settings can be supplied on the command line using this switch. This switch can be specified multiple times for separate settings and any settings passed here will override the settings in the profile.

Any name-value pair that can be written in a profile can be passed through this parameter. This includes options to control the conversion settings as well as the behavior of the individual converters as well. See Creating and Customizing Profiles for more information about the name-value pairs that can be used.

Examples:

These first two are settings that control the converter options, such as what pages to print, and the output that PowerPoint will print.

/D="PrintRange:1-5"

/D="PowerPoint.PrintOptionsOutputType:PrintOutputNotesPages"

 

These two settings control the output file creation options, and would override or add to the settings in the conversion profile passed using the /P switch.

/D="Image Options;Fax Resolution:3"

/D="TIFF File Format;BW compression:Group3-2D"

 

These two settings control the where the failed results log files are created and are most often used along with the /FAIL switch to control where the results log files are saved.

/D="KeepFailedItemResultsFiles:TRUE"

/D="UseDateTimeInFailedFolder:FALSE"

 

/E - File Extension Mapping

A file extension mapping profile uses the extension of the source file to determine what converter will be used to convert the file before combining them together. Like the conversion profiles, this file is also an XML file. This switch is optional and an internal default mapping is provided. You would only need to provide this file if you wanted to override the default file extension to converter mappings provided.

Examples:

/E="Custom Extension To Converter Map"

 

/W - Wait Time

Use this switch wait to the specified number of seconds for the Document Conversion Service to be running and available to convert and combine documents. If Document Conversion Service is already running the command executes immediately. If the Document Conversion Service is not running in the timeout period specified, the command will return with an error.

If this argument is not specified the command will return immediately with an error if Document Conversion Service is not running.

Example:

/W=300

 

/I - Input text file path

The collection of files to be combined can be passed as a text file containing a list of files, one each per line. The full path or a UNC path to the source file must be given for the files listed in the input text file; relative paths are not supported.

If the path to the file includes spaces it must be enclosed in quotes.

If the file doesn't exist, the conversion will fail.

 

The files are combined together in the order in which they are listed in the folder. Any files were specified directly on the command line before this switch are combined before adding the files in the input text file. Any source files specified on the command line after this switch are combined after the files in the input text file.

The input text file should follow the following format:

C:\Input\WordFiles\File1.doc

C:\Input\WordFiles\File2.docx;C:\OutputPath\WordFiles\

C:\Input\PDF\File3.pdf;C:\OutputPath\PDFFIles\

\\server\share\Input\scans\scan1.tif

 

/C - Convert on a Remote Computer (DCOM)

If Document Conversion Service is running on a different computer, use this switch to pass the name of the remote computer and the path of a shared location that both computers have access to. Separate the name of the remote computer and the path to the shared folder location with a semi-colon.

When combining remotely, the client redistributable, PNDocConvClientSetup_3.0.exe, must be installed on the computer running this command line utility. The client setup install program is included as part of the Document Conversion Service install and can be found in the \Samples\Redist folder in your product installation folder.

Examples:

/C="DOCCONV_SERVER;\\DOCCONV_SERVER\DCSREMOTE"

 

/SIL - Smart Inspect Logging File

Smart Inspect Log files are a tracing of the entire conversion process and are not the same as the conversion results log files created when a conversion fails. These logs can be viewed using the SmartInspect Redistributable Console included with Document Conversion Service.

These log files are automatically deleted when conversion succeeds. To keep the log files on success use the custom setting AlwaysKeepProcessingLoggingFiles as shown below.

The default location for this file is the TEMP folder. Each logging file is assigned a unique date, time and thread prefix followed by "_PNCombineFiles.sil", such as 2014_09_11_2_38_00_PM_4_PNCombineFiles.sil.

Use this argument to specify a custom path and optional file name for the SmartInspect logging file (*.sil) created by this utility. The /SIL switch can take a folder, or a path to a filename. If a path without a trailing backslash is provided, the last part of the path is assumed to be a filename.

Note: The double ending backslash used when specifying a folder for the /SIL switch is required for the command line path to be parsed correctly.

/SIL=

Is interpreted as...

"C:\Test\LogFile"

Create the SmartInspect log file as C:\Test\LogFile.sil.

"C:\Test\LogFile\\"

Create the SmartInspect log file as C:\Test\LogFile\datetime_PNCombineFiles.sil

"C:\Test\LogFile\ConvertFileCustom.sil"

Create the SmartInspect log file as C:\Test\LogFile\ConvertFileCustom.sil

The following settings can be used to control the creation and naming of the logging file. These settings are all passed using the /D switch.

Custom Setting

Description

RemoveDateTimePrefixOnProcessingLoggingFiles

Pass True to disable the adding of the unique date, time and thread prefix when a custom file name has not been specified in the ConvertFileProcessLoggingPath parameter.

KeepFailedProcessingLoggingFiles

Pass as False to disable the automatic creation of SmartInspect logging files when conversion fails. This setting can be overridden by AlwaysKeepProcessingLoggingFiles.

AlwaysKeepProcessingLoggingFiles

When set to True, the SmartInspect logging files are always created in the %TEMP% or other specified folder for both successful and failed conversions. If set to False, no logging files are created. This setting will override the KeepFailedProcessingLoggingFiles setting.

Examples:

Pass a custom folder and remove the prefix, each run will overwrite the log file C:\PEERNET\Logs\PNCombineFiles.sil.

/SIL="C:\PEERNET\Logs\\" /D="RemoveDateTimePrefixOnProcessingLoggingFiles:TRUE"

 

Pass a custom folder and log file name and remove the prefix. Each run will overwrite the logging file C:\PEERNET\Logs\MyLogFile.sil.

/SIL="C:\PEERNET\Logs\MyLogFile" /D="RemoveDateTimePrefixOnProcessingLoggingFiles:TRUE"

 

Don't save any SmartInspect log files at all.

/D="AlwaysKeepProcessingLoggingFiles:FALSE"

 

/T - Alternate Temp Folder

This is an advanced setting that should not be needed in most cases. When converting files, the conversion tool copies each file and performs the conversion in temporary staging and working folders created on demand in the default Windows temp folder. When dealing with long path and file names the default folders created can occasionally cause path names that are too long to process. When this happens this switch can be used to set the temporary folder to a shorter path to allow processing.

This setting is overridden if the /C option for remote conversion is being used with its own path to a shared location for conversion.

Examples:

/T="C:\PNTemp\\"

 

/? - Display Help

When passed as the only argument this switch will display help for this command.

 

File

The full path to the files to combine. You can list more than one on the command line.

The files are combined together in the order in which they listed on the command line. If any files were specified in an input text file using the /I switch before these files, the files listed in the input text file are combined before adding the files from the command line. If you specify the input text file after the files on the command line, the command line files are combined first, then the files listed in the input text file.

If the path to the file includes spaces it must be enclosed in quotes.

If the file doesn't exist, the conversion will fail.