SaveOptions.CreateSaveOptions

SaveOptions CreateSaveOptions method. Creates a save options object of a class suitable for the specified save format.

CreateSaveOptions(SaveFormat)

Creates a save options object of a class suitable for the specified save format.

public static SaveOptions CreateSaveOptions(SaveFormat saveFormat)
ParameterTypeDescription
saveFormatSaveFormatThe save format for which to create a save options object.

Return Value

An object of a class that derives from SaveOptions.

Examples

Shows how to specify custom time zone used for date/time fields.

SaveOptions so = SaveOptions.CreateSaveOptions(SaveFormat.Pdf);
so.CustomTimeZoneInfo = TimeZoneInfo.CreateCustomTimeZone("Custom", new TimeSpan(-10, 0, 0), "Custom", "Custom");

Converter.Create()
    .From(MyDir + "DateSdt.docx")
    .To(ArtifactsDir + "SaveOptions.CustomTimeZoneInfo.pdf", so)
    .Execute();

See Also


CreateSaveOptions(string)

Creates a save options object of a class suitable for the file extension specified in the given file name.

public static SaveOptions CreateSaveOptions(string fileName)
ParameterTypeDescription
fileNameStringThe extension of this file name determines the class of the save options object to create.

Return Value

An object of a class that derives from SaveOptions.

Examples

Shows how to specify default template.

string outputPath = ArtifactsDir + "SaveOptions.DefaultTemplate.docx";

SaveOptions so = SaveOptions.CreateSaveOptions(outputPath);
so.DefaultTemplate = MyDir + "Business brochure.dotx";

Converter.Create()
    .From(MyDir + "TOC.docx")
    .To(outputPath, so)
    .Execute();

See Also