Class Converter
Namespace: Aspose.Words.LowCode
Assembly: Aspose.Words.dll (25.8.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, LoadOptions) , Processor.From(Stream, LoadOptions) , 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.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.
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.
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.
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.
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.
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.
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.
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”
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
ExecuteCore()
protected override void ExecuteCore()</stream></stream>