Description
Convert the input file to a new file with the specified name (no extension is needed) using the converter specified. The type of file created is specified by the conversion options set in the IPNDocConvQueueItem's settings collection before calling this method.
Syntax
expression.Convert(ConverterPlugInName, Input, Output)
where expression is an IPNDocConvQueueItem object.
Parameters
String ConverterPlugInName
A list of one or more converters to use to try and convert the file. Multiple converters can be specified as a semi-colon separated list. The first matching converter in the list is used. See Converters for a list of converter names that can be used.
String Input
The input file to convert. This needs to be a UNC-based path if the conversion is being done from a mapped drive.
String Output
The full path and name of the output file, without the file extension. The file extension is automatically added based on the conversion type.
Exceptions
Exception |
Condition |
COMException |
There The following errors will cause this exception. The exception message details the cause of the error.
•Document Conversion Service is not running or is unavailable •The converter specified is unavailable •The item failed to convert in the timeout set by Document Conversion Service |
See Also:
Contains Get Set Remove Converters
Examples
Code Sample - C# |
|
PNDocConvQueueServiceLib.PNDocConvQueueItem item = null;
try { // Create the conversion item item = new PNDocConvQueueServiceLib.PNDocConvQueueItem();
// Set conversion settings item.Set("Devmode settings;Resolution", "200"); item.Set("Save;Output File Format", "TIFF Multipaged"); item.Set("Save;Append", "0"); item.Set("Save;Color reduction", "BW"); item.Set("Save;Dithering method", "Floyd"); item.Set("TIFF File Format;BW compression", "Group4"); item.Set("TIFF File Format;Color compression", "LZW RGB"); item.Set("TIFF File Format;Indexed compression", "LZW"); item.Set("TIFF File Format;Greyscale compression", "LZW");
// convert the file, use Microsoft Word or OutsideIn AX // whichever is found first item.Convert("Microsoft Word;Outside-In AX", @"C:\Test\Report.docx", @"C:\Test\Out\ConvertedReport"); } catch (Exception ex) { MessageBox.Show(this, "An error has occured.\n\n" + ex.ToString()); } finally { if (item != null) { System.Runtime.InteropServices.Marshal.FinalReleaseComObject(item); } item = null; } |
Code Sample - VB |
|
Dim item As PNDocConvQueueServiceLib.IPNDocConvQueueItem ' whichever is found first |