ConvertToImages
内容
[
隐藏
]ConvertToImages(string, SaveFormat)
将指定输入文件的页面转换为指定格式的图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(string inputFile, SaveFormat saveFormat)
范围 | 类型 | 描述 |
---|---|---|
inputFile | String | 输入文件名。 |
saveFormat | SaveFormat | 保存格式。仅允许图像保存格式。 |
返回值
返回图像流数组。这些流应由最终用户处理。
例子
展示如何将文档转换为图像流。
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);
也可以看看
- enum SaveFormat
- class Converter
- 命名空间 Aspose.Words.LowCode
- 部件 Aspose.Words
ConvertToImages(string, ImageSaveOptions)
使用指定的保存选项将指定输入文件的页面转换为图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(string inputFile, ImageSaveOptions saveOptions)
范围 | 类型 | 描述 |
---|---|---|
inputFile | String | 输入文件名。 |
saveOptions | ImageSaveOptions | 图像保存选项。 |
返回值
返回图像流数组。这些流应由最终用户处理。
例子
展示如何将文档转换为图像流。
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);
也可以看看
- class ImageSaveOptions
- class Converter
- 命名空间 Aspose.Words.LowCode
- 部件 Aspose.Words
ConvertToImages(Stream, SaveFormat)
将指定输入流的页面转换为指定格式的图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(Stream inputStream, SaveFormat saveFormat)
范围 | 类型 | 描述 |
---|---|---|
inputStream | Stream | 输入流。 |
saveFormat | SaveFormat | 保存格式。仅允许图像保存格式。 |
返回值
返回图像流数组。这些流应由最终用户处理。
例子
展示如何将文档从流转换为图像。
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);
}
也可以看看
- enum SaveFormat
- class Converter
- 命名空间 Aspose.Words.LowCode
- 部件 Aspose.Words
ConvertToImages(Stream, ImageSaveOptions)
使用指定的保存选项将指定输入流的页面转换为图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(Stream inputStream, ImageSaveOptions saveOptions)
范围 | 类型 | 描述 |
---|---|---|
inputStream | Stream | 输入流。 |
saveOptions | ImageSaveOptions | 图像保存选项。 |
返回值
返回图像流数组。这些流应由最终用户处理。
例子
展示如何将文档从流转换为图像。
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);
}
也可以看看
- class ImageSaveOptions
- class Converter
- 命名空间 Aspose.Words.LowCode
- 部件 Aspose.Words
ConvertToImages(Stream, LoadOptions, ImageSaveOptions)
使用提供的加载和保存选项将指定输入流的页面转换为图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(Stream inputStream, LoadOptions loadOptions,
ImageSaveOptions saveOptions)
范围 | 类型 | 描述 |
---|---|---|
inputStream | Stream | 输入流。 |
loadOptions | LoadOptions | 输入文档加载选项。 |
saveOptions | ImageSaveOptions | 图像保存选项。 |
返回值
返回图像流数组。这些流应由最终用户处理。
例子
展示如何将文档从流转换为图像。
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);
}
也可以看看
- class LoadOptions
- class ImageSaveOptions
- class Converter
- 命名空间 Aspose.Words.LowCode
- 部件 Aspose.Words
ConvertToImages(Document, SaveFormat)
将指定文档的页面转换为指定格式的图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(Document doc, SaveFormat saveFormat)
范围 | 类型 | 描述 |
---|---|---|
doc | Document | 输入文档。 |
saveFormat | SaveFormat | 保存格式。仅允许图像保存格式。 |
返回值
返回图像流数组。这些流应由最终用户处理。
例子
展示如何将文档转换为图像流。
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);
也可以看看
- class Document
- enum SaveFormat
- class Converter
- 命名空间 Aspose.Words.LowCode
- 部件 Aspose.Words
ConvertToImages(Document, ImageSaveOptions)
使用指定的保存选项将指定文档的页面转换为图像,并返回包含图像的流数组。
public static Stream[] ConvertToImages(Document doc, ImageSaveOptions saveOptions)
范围 | 类型 | 描述 |
---|---|---|
doc | Document | 输入文档。 |
saveOptions | ImageSaveOptions | 图像保存选项。 |
返回值
返回图像流数组。这些流应由最终用户处理。
例子
展示如何将文档转换为图像流。
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);
也可以看看
- class Document
- class ImageSaveOptions
- class Converter
- 命名空间 Aspose.Words.LowCode
- 部件 Aspose.Words