Convert

Convert(string, string)

Converts the given input document into the output document using specified input output file names and its extensions.

public static void Convert(string inputFile, string outputFile)
ParameterTypeDescription
inputFileStringThe input file name.
outputFileStringThe output file name.

Examples

Shows how to convert documents with a single line of code.

string doc = MyDir + "Document.docx";

Converter.Convert(doc, ArtifactsDir + "LowCode.Convert.pdf");

Converter.Convert(doc, ArtifactsDir + "LowCode.Convert.SaveFormat.rtf", SaveFormat.Rtf);

OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = true };
Converter.Convert(doc, loadOptions, ArtifactsDir + "LowCode.Convert.LoadOptions.docx", saveOptions);

Converter.Convert(doc, ArtifactsDir + "LowCode.Convert.SaveOptions.docx", saveOptions);

See Also


Convert(string, string, SaveFormat)

Converts the given input document into the output document using specified input output file names and the final document format.

public static void Convert(string inputFile, string outputFile, SaveFormat saveFormat)
ParameterTypeDescription
inputFileStringThe input file name.
outputFileStringThe output file name.
saveFormatSaveFormatThe save format.

Examples

Shows how to convert documents with a single line of code.

string doc = MyDir + "Document.docx";

Converter.Convert(doc, ArtifactsDir + "LowCode.Convert.pdf");

Converter.Convert(doc, ArtifactsDir + "LowCode.Convert.SaveFormat.rtf", SaveFormat.Rtf);

OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = true };
Converter.Convert(doc, loadOptions, ArtifactsDir + "LowCode.Convert.LoadOptions.docx", saveOptions);

Converter.Convert(doc, ArtifactsDir + "LowCode.Convert.SaveOptions.docx", saveOptions);

See Also


Convert(string, string, SaveOptions)

Converts the given input document into the output document using specified input output file names and save options.

public static void Convert(string inputFile, string outputFile, SaveOptions saveOptions)
ParameterTypeDescription
inputFileStringThe input file name.
outputFileStringThe output file name.
saveOptionsSaveOptionsThe save options.

Examples

Shows how to convert documents with a single line of code.

string doc = MyDir + "Document.docx";

Converter.Convert(doc, ArtifactsDir + "LowCode.Convert.pdf");

Converter.Convert(doc, ArtifactsDir + "LowCode.Convert.SaveFormat.rtf", SaveFormat.Rtf);

OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = true };
Converter.Convert(doc, loadOptions, ArtifactsDir + "LowCode.Convert.LoadOptions.docx", saveOptions);

Converter.Convert(doc, ArtifactsDir + "LowCode.Convert.SaveOptions.docx", saveOptions);

See Also


Convert(string, LoadOptions, string, SaveOptions)

Converts the given input document into the output document using specified input output file names its load/save options.

public static void Convert(string inputFile, LoadOptions loadOptions, string outputFile, 
    SaveOptions saveOptions)
ParameterTypeDescription
inputFileStringThe input file name.
loadOptionsLoadOptionsThe input document load options.
outputFileStringThe output file name.
saveOptionsSaveOptionsThe save options.

Examples

Shows how to convert documents with a single line of code.

string doc = MyDir + "Document.docx";

Converter.Convert(doc, ArtifactsDir + "LowCode.Convert.pdf");

Converter.Convert(doc, ArtifactsDir + "LowCode.Convert.SaveFormat.rtf", SaveFormat.Rtf);

OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = true };
Converter.Convert(doc, loadOptions, ArtifactsDir + "LowCode.Convert.LoadOptions.docx", saveOptions);

Converter.Convert(doc, ArtifactsDir + "LowCode.Convert.SaveOptions.docx", saveOptions);

See Also


Convert(Stream, Stream, SaveFormat)

Converts the given input document into a single output document using specified input and output streams.

public static void Convert(Stream inputStream, Stream outputStream, SaveFormat saveFormat)
ParameterTypeDescription
inputStreamStreamThe input stream.
outputStreamStreamThe output stream.
saveFormatSaveFormatThe save format.

Examples

Shows how to convert documents with a single line of code (Stream).

using (FileStream streamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertStream.1.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Convert(streamIn, streamOut, SaveFormat.Docx);

    OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
    LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = true };
    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertStream.2.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Convert(streamIn, loadOptions, streamOut, saveOptions);

    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertStream.3.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Convert(streamIn, streamOut, saveOptions);
}

See Also


Convert(Stream, Stream, SaveOptions)

Converts the given input document into a single output document using specified input and output streams.

public static void Convert(Stream inputStream, Stream outputStream, SaveOptions saveOptions)
ParameterTypeDescription
inputStreamStreamThe input streams.
outputStreamStreamThe output stream.
saveOptionsSaveOptionsThe save options.

Examples

Shows how to convert documents with a single line of code (Stream).

using (FileStream streamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertStream.1.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Convert(streamIn, streamOut, SaveFormat.Docx);

    OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
    LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = true };
    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertStream.2.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Convert(streamIn, loadOptions, streamOut, saveOptions);

    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertStream.3.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Convert(streamIn, streamOut, saveOptions);
}

See Also


Convert(Stream, LoadOptions, Stream, SaveOptions)

Converts the given input document into a single output document using specified input and output streams.

public static void Convert(Stream inputStream, LoadOptions loadOptions, Stream outputStream, 
    SaveOptions saveOptions)
ParameterTypeDescription
inputStreamStreamThe input streams.
loadOptionsLoadOptionsThe input document load options.
outputStreamStreamThe output stream.
saveOptionsSaveOptionsThe save options.

Examples

Shows how to convert documents with a single line of code (Stream).

using (FileStream streamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertStream.1.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Convert(streamIn, streamOut, SaveFormat.Docx);

    OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
    LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = true };
    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertStream.2.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Convert(streamIn, loadOptions, streamOut, saveOptions);

    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertStream.3.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Convert(streamIn, streamOut, saveOptions);
}

See Also