3.3.4.1 ConvertFile

The ConvertFile method takes a file passed as an array of bytes and uses the specified conversion application to convert it from one specified file format to another specified file format.

     CreateDCInfo ConvertFile(String launcherUri, 
                      String appExe, 
                      String convertFrom, 
                      String convertTo, 
                      Byte[] fileBits, 
                      String taskName, 
                      String configInfo, 
                      Int32 timeout, 
                      bool fReturnFileBits); 

launcherUri: The URL of the launcher service that performs the conversion. It MUST be 260 or fewer characters in length, and MUST be the URL of a launcher service that has implemented the IDocumentConversionsLauncher interface.

appExe: The name of the executable file of the conversion application that converts the document. This parameter MUST be set to a non-empty value.

convertFrom: The file extension of the file's original file format. This parameter MUST be set to a non-null value.

convertTo: The file extension of the file format to which the file MUST be converted. This parameter MUST be set to a non-null value.

fileBits: The file to be converted. This parameter MUST be set to a non-null value.

taskName: The name of the conversion task. This parameter MUST be set to a non-empty value and MUST be 270 or fewer characters in length.

configInfo: The configuration information that is specific to the conversion application. The value of this parameter is written to a file which is passed as a parameter to the conversion application. Specific uses of this parameter for specific types of conversions are discussed in Section 7.

timeout: The number of seconds that the launcher service MUST wait for the conversion application to complete before canceling the conversion. The launcher service MUST cancel the conversion if the conversion application does not complete in the specified amount of time. This parameter MUST be set to a value greater than 0 and less than or equal to 1800.

fReturnFileBits: Specifies whether to return the result file in the m_rgbMainFile member of the CreateDCInfo common data type returned by the function. If this parameter is set to true, the result file MUST be returned in the m_rgbMainFile member. If set to false, the result file MUST NOT be returned.

Return Value: An CreateDCInfo object with information about the result of the conversion. This method MUST return a non-null value.

Exceptions Thrown: No exceptions are thrown beyond those thrown by the .NET Remoting Core Protocol as specified in [MS-NRTP].