Class Converter
Namespace: Aspose.Words.LowCode
Assembly: Aspose.Words.dll
表示一组方法,旨在使用一行代码转换多种不同类型的文档。
public static class Converter
继承
继承成员
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
备注
指定的输入和输出文件或流,以及所需的保存格式,用于将给定输入文档的一种格式转换为另一种指定格式的输出文档。
转换功能支持超过 35 种不同的文件格式。
Aspose.Words.LowCode.Converter.ConvertToImages(System.String,System.String) 方法组旨在将文档转换为图像,每一页都转换为一个单独的图像文件。这些方法还可以直接将 PDF 文档转换为固定页面格式,而无需将其加载到文档模型中,从而提高了性能和准确性。
使用 Aspose.Words.Saving.ImageSaveOptions.PageSet,您可以指定要转换为图像的特定页面集。
方法
Convert(string, string)
使用指定的输入输出文件名及其扩展名将给定的输入文档转换为输出文档。
public static void Convert(string inputFile, string outputFile)
参数
inputFile
string
输入文件名。
outputFile
string
输出文件名。
Convert(string, string, SaveFormat)
使用指定的输入输出文件名和最终文档格式将给定的输入文档转换为输出文档。
public static void Convert(string inputFile, string outputFile, SaveFormat saveFormat)
参数
inputFile
string
输入文件名。
outputFile
string
输出文件名。
saveFormat
SaveFormat
保存格式。
Convert(string, string, SaveOptions)
使用指定的输入输出文件名和保存选项将给定的输入文档转换为输出文档。
public static void Convert(string inputFile, string outputFile, SaveOptions saveOptions)
参数
inputFile
string
输入文件名。
outputFile
string
输出文件名。
saveOptions
SaveOptions
保存选项。
Convert(string, LoadOptions, string, SaveOptions)
使用指定的输入输出文件名及其加载/保存选项将给定的输入文档转换为输出文档。
public static void Convert(string inputFile, LoadOptions loadOptions, string outputFile, SaveOptions saveOptions)
参数
inputFile
string
输入文件名。
loadOptions
LoadOptions
输入文档加载选项。
outputFile
string
输出文件名。
saveOptions
SaveOptions
保存选项。
Convert(Stream, Stream, SaveFormat)
使用指定的输入和输出流将给定的输入文档转换为单个输出文档。
public static void Convert(Stream inputStream, Stream outputStream, SaveFormat saveFormat)
参数
inputStream
Stream
输入流。
outputStream
Stream
输出流。
saveFormat
SaveFormat
保存格式。
Convert(Stream, Stream, SaveOptions)
使用指定的输入和输出流将给定的输入文档转换为单个输出文档。
public static void Convert(Stream inputStream, Stream outputStream, SaveOptions saveOptions)
参数
inputStream
Stream
输入流。
outputStream
Stream
输出流。
saveOptions
SaveOptions
保存选项。
Convert(Stream, LoadOptions, Stream, SaveOptions)
使用指定的输入和输出流将给定的输入文档转换为单个输出文档。
public static void Convert(Stream inputStream, LoadOptions loadOptions, Stream outputStream, SaveOptions saveOptions)
参数
inputStream
Stream
输入流。
loadOptions
LoadOptions
输入文档加载选项。
outputStream
Stream
输出流。
saveOptions
SaveOptions
保存选项。
ConvertToImages(string, string)
将指定输入文件的页面转换为图像文件。
public static void ConvertToImages(string inputFile, string outputFile)
参数
inputFile
string
输入文件名。
outputFile
string
用于生成页面图像文件名的输出文件名,规则为 “outputFile_pageIndex.extension”。
ConvertToImages(string, string, SaveFormat)
将指定输入文件的页面转换为指定格式的图像文件。
public static void ConvertToImages(string inputFile, string outputFile, SaveFormat saveFormat)
参数
inputFile
string
输入文件名。
outputFile
string
用于生成页面图像文件名的输出文件名,规则为 “outputFile_pageIndex.extension”。
saveFormat
SaveFormat
保存格式。仅允许图像保存格式。
ConvertToImages(string, string, ImageSaveOptions)
使用指定的保存选项将指定输入文件的页面转换为图像文件。
public static void ConvertToImages(string inputFile, string outputFile, ImageSaveOptions saveOptions)
参数
inputFile
string
输入文件名。
outputFile
string
用于生成页面图像文件名的输出文件名,规则为 “outputFile_pageIndex.extension”。
saveOptions
ImageSaveOptions
图像保存选项。
ConvertToImages(string, LoadOptions, string, ImageSaveOptions)
使用提供的加载和保存选项将指定输入文件的页面转换为图像文件。
public static void ConvertToImages(string inputFile, LoadOptions loadOptions, string outputFile, ImageSaveOptions saveOptions)
参数
inputFile
string
输入文件名。
loadOptions
LoadOptions
输入文档加载选项。
outputFile
string
用于生成页面图像文件名的输出文件名,规则为 “outputFile_pageIndex.extension”。
saveOptions
ImageSaveOptions
图像保存选项。
ConvertToImages(string, SaveFormat)
将指定输入文件的页面转换为指定格式的图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(string inputFile, SaveFormat saveFormat)
参数
inputFile
string
输入文件名。
saveFormat
SaveFormat
保存格式。仅允许图像保存格式。
返回
Stream[]
返回图像流的数组。这些流应由最终用户处置。
ConvertToImages(string, ImageSaveOptions)
使用指定的保存选项将指定输入文件的页面转换为图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(string inputFile, ImageSaveOptions saveOptions)
参数
inputFile
string
输入文件名。
saveOptions
ImageSaveOptions
图像保存选项。
返回
Stream[]
返回图像流的数组。这些流应由最终用户处置。
ConvertToImages(Stream, SaveFormat)
将指定输入流的页面转换为指定格式的图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(Stream inputStream, SaveFormat saveFormat)
参数
inputStream
Stream
输入流。
saveFormat
SaveFormat
保存格式。仅允许图像保存格式。
返回
Stream[]
返回图像流的数组。这些流应由最终用户处置。
ConvertToImages(Stream, ImageSaveOptions)
使用指定的保存选项将指定输入流的页面转换为图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(Stream inputStream, ImageSaveOptions saveOptions)
参数
inputStream
Stream
输入流。
saveOptions
ImageSaveOptions
图像保存选项。
返回
Stream[]
返回图像流的数组。这些流应由最终用户处置。
ConvertToImages(Stream, LoadOptions, ImageSaveOptions)
使用提供的加载和保存选项将指定输入流的页面转换为图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(Stream inputStream, LoadOptions loadOptions, ImageSaveOptions saveOptions)
参数
inputStream
Stream
输入流。
loadOptions
LoadOptions
输入文档加载选项。
saveOptions
ImageSaveOptions
图像保存选项。
返回
Stream[]
返回图像流的数组。这些流应由最终用户处置。
ConvertToImages(Document, SaveFormat)
将指定文档的页面转换为指定格式的图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(Document doc, SaveFormat saveFormat)
参数
doc
Document
输入文档。
saveFormat
SaveFormat
保存格式。仅允许图像保存格式。
返回
Stream[]
返回图像流的数组。这些流应由最终用户处置。
ConvertToImages(Document, ImageSaveOptions)
使用指定的保存选项将指定文档的页面转换为图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(Document doc, ImageSaveOptions saveOptions)
参数
doc
Document
输入文档。
saveOptions
ImageSaveOptions
图像保存选项。
返回
Stream[]
返回图像流的数组。这些流应由最终用户处置。