Conversion Options

The following example demonstrates using the ConversionOptions class. The ConversionOptions class is the class used to specify available options for a specific conversion. Options such as the output page orientation, page size, margins, unit type, and whether to append to a current document are all handled using the ConversionOptions class.

NOTE: Use the HtmlConversionOption object when calling the ConvertHtmlString method.

The following example illustrates setting a specific page size and margins for the output PDF. It then applies the conversion options to the Converter.Convert constructor as parameters which then convert the document.

ConversionOptions options = new ConversionOptions(720, 720, 72, true);
Converter.Convert(docxFilePath, pdfFilePath, options);
Dim options As ConversionOptions = New ConversionOptions(720, 720, 72, True)
Converter.Convert(docxFilePath, pdfFilePath, options)

Specific Converter Options

Depending upon the converter document type, you can also use the following conversion options classes. The following lists the specific converters and conversion options available.

Converter Class Name Corresponding Options
ExcelConverter ExcelConversionOptions
HtmlConverter HtmlConversionOptions
ImageConverter ImageConversionOptions
PowerPointConverter PowerPointConversionOptions
RtfConverter RtfConversionOptions
TextConverter TextConversionOptions
WordConverter WordConversionOptions

GitHub Project

Refer to the converter-dotnet-core example project on GitHub for examples using C# and Visual Basic. Each converter class has an example that also demonstrates using the class's conversion options.

In this topic