A command line utility to convert a file using Document Conversion Service. The Document Conversion Service must be running, either locally or on a remote computer for the file to be converted. If it is not running the command will return immediately with an error.

 

DCSConvertFile /P=profile [/S=save location] [/N=output name] [/O] [/NE] [/L] 

               [/D="name:value"] [/E=extension map]

               [/W=wait time] [/FAIL=failed results log file location]

               [/SIL=conversion log file path]

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

               [/T=alternate temp folder]

               sourcefile

 

Sample Command Lines

Convert a single file to a TIFF:

DCSConvertFile /P="TIFF 200dpi Monochrome" "C:\Test\Document.doc"

Send the file C:\Test\Document.doc to Document Conversion Service to be converted using the settings contained in the conversion profile TIFF 200dpi Monochrome.xml.

The converted file, Document.doc.tif, is saved in C:\Test\, the same location as the source file.

If a file of the same name already existed, this conversion would fail and a .failed folder would be created in the same location as the source document, C:\Test. The results log would be named Document.doc.failed.dcsresults and saved to a new subfolder under the .failed folder. The subfolder is named using the date and time of the conversion to keep subsequent runs separate.

To overwrite an existing file the /O switch would need to be added to the above command. If you did not want the source file extension as part of your file name, the /NE switch would need to be added.

 

Convert a single file to a TIFF with a specific output name, overwrite existing files:

DCSConvertFile /O /N="Opt_Document" /P="TIFF 300dpi OptimizedColor"

                   "C:\Test\Document.doc"

Send the file C:\Test\Document.doc to Document Conversion Service to be converted using the settings contained in the conversion profile TIFF 300dpi OptimizedColor.xml.

The converted file will be named Opt_Document.tif and saved in the same location as the source file. If a file of the same name already existed, this file would be overwritten with the new file.

 

Convert a single file to a TIFF in a specific location:

DCSConvertFile /S="C:\Output" /P="TIFF 200dpi Monochrome" "C:\Test\Document.doc"

Send the file C:\Test\Document.doc to Document Conversion Service to be converted using the settings contained in the conversion profile TIFF 200dpi Monochrome.xml.

The converted file will be named Document.doc.tif and placed in the folder named C:\Output.

If a file of the same name already existed, this conversion would fail and a .failed folder would be created in the same location as the source document, C:\Test. The results log would be named Document.doc.failed.dcsresults and saved to a new subfolder under the .failed folder. The subfolder is named using the date and time of the conversion to keep subsequent runs separate.

 

Convert a single file to a TIFF in a specific location, wait up to 5 minutes for the conversion service to start:

DCSConvertFile /S="C:\Output" /P="TIFF 200dpi Monochrome" /W=300

               "C:\Test\Document.doc"

Send the file C:\Test\Document.doc to Document Conversion Service to be converted using the settings contained in the conversion profile TIFF 200dpi Monochrome.xml. If Document Conversion Service is not running, wait up to 5 minutes (300 seconds) for the conversion service to be available.

The converted file will be named Document.doc.tif and placed in the folder named C:\Output.

If a file of the same name already existed, this conversion would fail and a .failed folder would be created in the same location as the source document, C:\Test. The results log would be named Document.doc.failed.dcsresults and saved to a new subfolder under the .failed folder. The subfolder is named using the date and time of the conversion to keep subsequent runs separate.

 

Convert a single file to a vector  PDF document, remove source extension and save the conversion results log file:

DCSConvertFile /P="Adobe PDF Multipage" /L /NE "C:\Test\Document.doc"

               /FAIL="C:\Test\FailedLogs\\" /D="UseDateTimeInFailedFolder:FALSE"

Send the file C:\Test\Document.doc to Document Conversion Service to be converted using the settings contained in the conversion profile Adobe PDF Multipage.xml. This profile creates vector PDF where possible.

The converted file will be named Document.doc.pdf and saved in the same location as the source file. A conversion results log file, Document.doc.succeeded.dcsresults will also be saved in same location as the source file.

If a file of the same name already existed, this conversion would fail. The results log would be named Document.doc.failed.dcsresults and  would be saved in the C:\Test\FailedLogs\ folder. The /D setting UseDateTimeInFailedFolder disables the date and time subfolder creation under the failed logs folder.

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.

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

 

Convert a single file to a vector PDF document, save the output to a specific location and save the conversion results log file:

DCSConvertFile /S="C:\Output" /N="NewFileName" /L /O

               /P="Adobe PDF Multipage" "C:\Test\Document.doc"

Creates a PDF document from the source file C:\Test\Document.doc. The type of PDF created is controlled by the settings in the conversion profile Adobe PDF Multipage.xml. This profile creates vector PDF where possible.

The converted file will be named NewFileName.pdf and saved in the C:\Output folder. If a file of the same name already exists in C:\Output\ this file would be overwritten with the new file.

A conversion results log file, Document.doc.succeeded.dcsresults will also be created in the C:\Output folder.

If the conversion did not succeed, the results log would be named Document.doc.failed.dcsresults and a .failed folder would be created in the same location as the source document, C:\Test. The results log would be named Document.doc.failed.dcsresults and saved to a new subfolder under the .failed folder. The subfolder is named using the date and time of the conversion to keep subsequent runs separate.

 

Convert a single file to a PDF document, save both the output and any failed conversion results log file to custom locations :

DCSConvertFile /S="C:\Output" /N="NewFileName" /L /O

                  /P="PDF A-1b 300dpi OptimizedColor"

                  /FAIL="C:\FailedResults\\" "C:\Test\Document.doc"

Creates a PDF document from the source file C:\Test\Document.doc. The type of PDF created is controlled by the settings in the conversion profile PDF A-1b 300dpi OptimizedColor.xml.

The converted file will be named NewFileName.pdf and saved in the C:\Output folder. If a file of the same name already exists in C:\Output\ this file would be overwritten with the new file as specified by the /O argument.

A conversion results log file, Document.doc.succeeded.dcsresults will be created in the C:\FailedResults folder if the conversion does not succeed. The results log is named Document.doc.failed.dcsresults and placed in a subfolder named with the current date and time created under the specified folder.

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.

Use the command line argument D="UseDateTimeInFailedFolder:FALSE" to store the results log file directly in the folder C:\FailedResults.

 

Command Line Arguments

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

/S - The Save Location

Pass in the full path to the folder in which to save the new file. If the save location is not specified the new file is created in the same folder as the source file.

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. The /O option can be used to enable file overwriting, which is off by default.

 

Example:

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

 

/N - Output File Name

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.

If this argument is not specified the name of the source file, including the extension is used. This prevents name collision when you have two different files with the same base name, such as abc.doc and abc.pdf. If you were converting to multipaged TIFF images the resulting converted files would be named abc.doc.tif and abc.pdf.tif.

If you do not want the original file name extension as part of your file name, use the /NE switch to remove the file extension.

If serialized files, such as JPEG images, are being created, the base name will be appended with the page number, SampleDocument_0001.jpg, SampleDocument_002.jpg, etc.

Example:

/N="SampleDocument_06_15_2012"

 

/O - Overwrite Always

Enables overwrite mode so that existing files of the same name are overwritten with the new file. When not specified the conversion will fail if a file of the same name already exists in the output folder.

 

/NE - No Extension

If you do not want the original file name extension as part of your output file name, use this switch to remove the file extension. If you have provided an output name with the /N switch above, this argument is ignored.

 

/L - Results Log

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

The name of the results log file is based on the name of the original file and also indicates the conversion status. For example, when converting Document.doc, a successful conversion will create a log file named Document.doc.succeeded.dcsresults., while a failed conversion would be named Document.doc.failed.dcsresults.

The results log file for a successful conversion is always copied to the output location with the converted files when this flag is used.

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 - Failed Results Log File Location

In the case of a failed conversion, the conversion results log file is always created. The default behavior is to create a .failed folder in the same location as the source file and save the conversion results log file to a new subfolder under the .failed folder. The subfolder is named using the date and time of the conversion to keep subsequent runs separate.

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 files. The name of the results log file is based on the name of the original file and also indicates the conversion status. For example, when converting Document.doc, a failed conversion would be named Document.doc.failed.dcsresults.

You can suppress the use of the date and time subfolder by passing the UseDateTimeInFailedFolder setting using the /D switch.

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. These settings can also be added to any conversion profile you are using.

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.

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"

 

/P - Conversion Profile

This is a required argument. 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 conversion and 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. 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 to wait to the specified number of seconds for the Document Conversion Service to be running and available to convert 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

 

/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 converting 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 "_PNConvertFile.sil", such as 2014_09_11_2_38_00_PM_4_PNConvertFile.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_PNConvertFile.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\PNConvertFile.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 a file, the conversion tool copies the 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.

 

Source File

The full path to the file to convert.

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

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