Class Converter
Namespace: Aspose.Words.LowCode
Assembly: Aspose.Words.dll (25.12.0)
Represents a group of methods intended to convert a variety of different types of documents using a single line of code.
public class Converter : ProcessorInheritance
object ← Processor ← Converter
Inherited Members
Processor.mResultDocument , Processor.From(string) , Processor.From(string, LoadOptions) , Processor.From(Stream) , Processor.From(Stream, LoadOptions) , Processor.To(string) , Processor.To(string, SaveOptions) , Processor.To(string, SaveFormat) , Processor.To(Stream, SaveOptions) , Processor.To(Stream, SaveFormat) , Processor.To(List<Stream>, SaveOptions) , Processor.To(List<Stream>, SaveFormat) , Processor.Execute() , Processor.Execute(CancellationToken) , Processor.ExecuteCore() , Processor.CheckArgumentsSet() , Processor.GetPartFileName(string, int, SaveFormat) , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Remarks
The specified input and output files or streams, along with the desired save format, are used to convert the given input document of the one format into the output document of the other specified format.
The convert functionality supports over 35+ different file formats.
The Aspose.Words.LowCode.Converter.ConvertToImages(System.String,Aspose.Words.SaveFormat) group of methods are designed to transform documents into images, with each page being converted into a separate image file. These methods also convert PDF documents directly to fixed-page formats without loading them into the document model, which enhances both performance and accuracy.
With Aspose.Words.Saving.ImageSaveOptions.PageSet, you can specify a particular set of pages to convert into images.
Methods
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)Parameters
inputFile string
The input file name.
outputFile string
The 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);Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
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)Parameters
inputFile string
The input file name.
outputFile string
The output file name.
saveFormat SaveFormat
The 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);Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
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)Parameters
inputFile string
The input file name.
outputFile string
The output file name.
saveOptions SaveOptions
The 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);Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
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)Parameters
inputFile string
The input file name.
loadOptions LoadOptions
The input document load options.
outputFile string
The output file name.
saveOptions SaveOptions
The 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);Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
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)Parameters
inputStream Stream
The input stream.
outputStream Stream
The output stream.
saveFormat SaveFormat
The 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);
}Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
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)Parameters
inputStream Stream
The input streams.
outputStream Stream
The output stream.
saveOptions SaveOptions
The 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);
}Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
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)Parameters
inputStream Stream
The input streams.
loadOptions LoadOptions
The input document load options.
outputStream Stream
The output stream.
saveOptions SaveOptions
The 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);
}Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
ConvertToImages(string, string)
Converts the pages of the specified input file to image files.
[Obsolete("Use Converter.Convert method instead.")]
public static void ConvertToImages(string inputFile, string outputFile)Parameters
inputFile string
The input file name.
outputFile string
The output file name used to generate file name for page images using rule “outputFile_pageIndex.extension”
Examples
Shows how to convert document to images.
string doc = MyDir + "Big document.docx";
Converter.Convert(doc, ArtifactsDir + "LowCode.ConvertToImages.1.png");
Converter.Convert(doc, ArtifactsDir + "LowCode.ConvertToImages.2.jpeg", SaveFormat.Jpeg);
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = false };
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PageSet = new PageSet(1);
Converter.Convert(doc, loadOptions, ArtifactsDir + "LowCode.ConvertToImages.3.png", imageSaveOptions);
Converter.Convert(doc, ArtifactsDir + "LowCode.ConvertToImages.4.png", imageSaveOptions);ConvertToImages(string, string, SaveFormat)
Converts the pages of the specified input file to image files in the specified format.
[Obsolete("Use Converter.Convert method instead.")]
public static void ConvertToImages(string inputFile, string outputFile, SaveFormat saveFormat)Parameters
inputFile string
The input file name.
outputFile string
The output file name used to generate file name for page images using rule “outputFile_pageIndex.extension”
saveFormat SaveFormat
Save format. Only image save formats are allowed.
Examples
Shows how to convert document to images.
string doc = MyDir + "Big document.docx";
Converter.Convert(doc, ArtifactsDir + "LowCode.ConvertToImages.1.png");
Converter.Convert(doc, ArtifactsDir + "LowCode.ConvertToImages.2.jpeg", SaveFormat.Jpeg);
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = false };
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PageSet = new PageSet(1);
Converter.Convert(doc, loadOptions, ArtifactsDir + "LowCode.ConvertToImages.3.png", imageSaveOptions);
Converter.Convert(doc, ArtifactsDir + "LowCode.ConvertToImages.4.png", imageSaveOptions);ConvertToImages(string, string, ImageSaveOptions)
Converts the pages of the specified input file to image files using the specified save options.
[Obsolete("Use Converter.Convert method instead.")]
public static void ConvertToImages(string inputFile, string outputFile, ImageSaveOptions saveOptions)Parameters
inputFile string
The input file name.
outputFile string
The output file name used to generate file name for page images using rule “outputFile_pageIndex.extension”
saveOptions ImageSaveOptions
Image save options.
Examples
Shows how to convert document to images.
string doc = MyDir + "Big document.docx";
Converter.Convert(doc, ArtifactsDir + "LowCode.ConvertToImages.1.png");
Converter.Convert(doc, ArtifactsDir + "LowCode.ConvertToImages.2.jpeg", SaveFormat.Jpeg);
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = false };
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PageSet = new PageSet(1);
Converter.Convert(doc, loadOptions, ArtifactsDir + "LowCode.ConvertToImages.3.png", imageSaveOptions);
Converter.Convert(doc, ArtifactsDir + "LowCode.ConvertToImages.4.png", imageSaveOptions);ConvertToImages(string, LoadOptions, string, ImageSaveOptions)
Converts the pages of the specified input file to image files using the provided load and save options.
[Obsolete("Use Converter.Convert method instead.")]
public static void ConvertToImages(string inputFile, LoadOptions loadOptions, string outputFile, ImageSaveOptions saveOptions)Parameters
inputFile string
The input file name.
loadOptions LoadOptions
The input document load options.
outputFile string
The output file name used to generate file name for page images using rule “outputFile_pageIndex.extension”
saveOptions ImageSaveOptions
Image save options.
Examples
Shows how to convert document to images.
string doc = MyDir + "Big document.docx";
Converter.Convert(doc, ArtifactsDir + "LowCode.ConvertToImages.1.png");
Converter.Convert(doc, ArtifactsDir + "LowCode.ConvertToImages.2.jpeg", SaveFormat.Jpeg);
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = false };
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PageSet = new PageSet(1);
Converter.Convert(doc, loadOptions, ArtifactsDir + "LowCode.ConvertToImages.3.png", imageSaveOptions);
Converter.Convert(doc, ArtifactsDir + "LowCode.ConvertToImages.4.png", imageSaveOptions);ConvertToImages(string, SaveFormat)
Converts the pages of the specified input file to images in the specified format and returns an array of streams containing the images.
public static Stream[] ConvertToImages(string inputFile, SaveFormat saveFormat)Parameters
inputFile string
The input file name.
saveFormat SaveFormat
Save format. Only image save formats are allowed.
Returns
Stream []
Returns array of image streams. The streams should be disposed by the end user.
Examples
Shows how to convert document to images stream.
string doc = MyDir + "Big document.docx";
Stream[] streams = Converter.ConvertToImages(doc, SaveFormat.Png);
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PageSet = new PageSet(1);
streams = Converter.ConvertToImages(doc, imageSaveOptions);
streams = Converter.ConvertToImages(new Document(doc), SaveFormat.Png);
streams = Converter.ConvertToImages(new Document(doc), imageSaveOptions);ConvertToImages(string, ImageSaveOptions)
Converts the pages of the specified input file to images using the specified save options and returns an array of streams containing the images.
public static Stream[] ConvertToImages(string inputFile, ImageSaveOptions saveOptions)Parameters
inputFile string
The input file name.
saveOptions ImageSaveOptions
Image save options.
Returns
Stream []
Returns array of image streams. The streams should be disposed by the end user.
Examples
Shows how to convert document to images stream.
string doc = MyDir + "Big document.docx";
Stream[] streams = Converter.ConvertToImages(doc, SaveFormat.Png);
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PageSet = new PageSet(1);
streams = Converter.ConvertToImages(doc, imageSaveOptions);
streams = Converter.ConvertToImages(new Document(doc), SaveFormat.Png);
streams = Converter.ConvertToImages(new Document(doc), imageSaveOptions);ConvertToImages(Stream, SaveFormat)
Converts the pages of the specified input stream to images in the specified format and returns an array of streams containing the images.
public static Stream[] ConvertToImages(Stream inputStream, SaveFormat saveFormat)Parameters
inputStream Stream
The input stream.
saveFormat SaveFormat
Save format. Only image save formats are allowed.
Returns
Stream []
Returns array of image streams. The streams should be disposed by the end user.
Examples
Shows how to convert document to images from stream.
using (FileStream streamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
Stream[] streams = Converter.ConvertToImages(streamIn, SaveFormat.Jpeg);
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PageSet = new PageSet(1);
streams = Converter.ConvertToImages(streamIn, imageSaveOptions);
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = false };
Converter.ConvertToImages(streamIn, loadOptions, imageSaveOptions);
}ConvertToImages(Stream, ImageSaveOptions)
Converts the pages of the specified input stream to images using the specified save options and returns an array of streams containing the images.
public static Stream[] ConvertToImages(Stream inputStream, ImageSaveOptions saveOptions)Parameters
inputStream Stream
The input stream.
saveOptions ImageSaveOptions
Image save options.
Returns
Stream []
Returns array of image streams. The streams should be disposed by the end user.
Examples
Shows how to convert document to images from stream.
using (FileStream streamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
Stream[] streams = Converter.ConvertToImages(streamIn, SaveFormat.Jpeg);
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PageSet = new PageSet(1);
streams = Converter.ConvertToImages(streamIn, imageSaveOptions);
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = false };
Converter.ConvertToImages(streamIn, loadOptions, imageSaveOptions);
}ConvertToImages(Stream, LoadOptions, ImageSaveOptions)
Converts the pages of the specified input stream to images using the provided load and save options, and returns an array of streams containing the images.
public static Stream[] ConvertToImages(Stream inputStream, LoadOptions loadOptions, ImageSaveOptions saveOptions)Parameters
inputStream Stream
The input stream.
loadOptions LoadOptions
The input document load options.
saveOptions ImageSaveOptions
Image save options.
Returns
Stream []
Returns array of image streams. The streams should be disposed by the end user.
Examples
Shows how to convert document to images from stream.
using (FileStream streamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
Stream[] streams = Converter.ConvertToImages(streamIn, SaveFormat.Jpeg);
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PageSet = new PageSet(1);
streams = Converter.ConvertToImages(streamIn, imageSaveOptions);
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = false };
Converter.ConvertToImages(streamIn, loadOptions, imageSaveOptions);
}ConvertToImages(Document, SaveFormat)
Converts the pages of the specified document to images in the specified format and returns an array of streams containing the images.
public static Stream[] ConvertToImages(Document doc, SaveFormat saveFormat)Parameters
doc Document
The input document.
saveFormat SaveFormat
Save format. Only image save formats are allowed.
Returns
Stream []
Returns array of image streams. The streams should be disposed by the end user.
Examples
Shows how to convert document to images stream.
string doc = MyDir + "Big document.docx";
Stream[] streams = Converter.ConvertToImages(doc, SaveFormat.Png);
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PageSet = new PageSet(1);
streams = Converter.ConvertToImages(doc, imageSaveOptions);
streams = Converter.ConvertToImages(new Document(doc), SaveFormat.Png);
streams = Converter.ConvertToImages(new Document(doc), imageSaveOptions);ConvertToImages(Document, ImageSaveOptions)
Converts the pages of the specified document to images using the specified save options and returns an array of streams containing the images.
public static Stream[] ConvertToImages(Document doc, ImageSaveOptions saveOptions)Parameters
doc Document
The input document.
saveOptions ImageSaveOptions
Image save options.
Returns
Stream []
Returns array of image streams. The streams should be disposed by the end user.
Examples
Shows how to convert document to images stream.
string doc = MyDir + "Big document.docx";
Stream[] streams = Converter.ConvertToImages(doc, SaveFormat.Png);
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PageSet = new PageSet(1);
streams = Converter.ConvertToImages(doc, imageSaveOptions);
streams = Converter.ConvertToImages(new Document(doc), SaveFormat.Png);
streams = Converter.ConvertToImages(new Document(doc), imageSaveOptions);Create()
Creates new instance of the converter processor.
public static Converter Create()Returns
Create(ConverterContext)
Creates new instance of the converter processor.
public static Converter Create(ConverterContext context)Parameters
context ConverterContext
Returns
Examples
Shows how to convert documents with a single line of code using context.
string doc = MyDir + "Big document.docx";
Converter.Create(new ConverterContext())
.From(doc)
.To(ArtifactsDir + "LowCode.ConvertContext.1.pdf")
.Execute();
Converter.Create(new ConverterContext())
.From(doc)
.To(ArtifactsDir + "LowCode.ConvertContext.2.pdf", SaveFormat.Rtf)
.Execute();
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = true };
Converter.Create(new ConverterContext())
.From(doc, loadOptions)
.To(ArtifactsDir + "LowCode.ConvertContext.3.docx", saveOptions)
.Execute();
Converter.Create(new ConverterContext())
.From(doc)
.To(ArtifactsDir + "LowCode.ConvertContext.4.png", new ImageSaveOptions(SaveFormat.Png))
.Execute();Shows how to convert documents from a stream with a single line of code using context.
string doc = MyDir + "Document.docx";
using (FileStream streamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertContextStream.1.docx", FileMode.Create, FileAccess.ReadWrite))
Converter.Create(new ConverterContext())
.From(streamIn)
.To(streamOut, SaveFormat.Rtf)
.Execute();
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = true };
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertContextStream.2.docx", FileMode.Create, FileAccess.ReadWrite))
Converter.Create(new ConverterContext())
.From(streamIn, loadOptions)
.To(streamOut, saveOptions)
.Execute();
List<Stream> pages = new List<Stream>();
Converter.Create(new ConverterContext())
.From(doc)
.To(pages, new ImageSaveOptions(SaveFormat.Png))
.Execute();
}ExecuteCore()
protected override void ExecuteCore()