ConvertToImages

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)
ParameterTypeDescription
inputFileStringThe input file name.
saveFormatSaveFormatSave format. Only image save formats are allowed.

Return Value

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);

See Also


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)
ParameterTypeDescription
inputFileStringThe input file name.
saveOptionsImageSaveOptionsImage save options.

Return Value

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);

See Also


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)
ParameterTypeDescription
inputStreamStreamThe input stream.
saveFormatSaveFormatSave format. Only image save formats are allowed.

Return Value

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);
}

See Also


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)
ParameterTypeDescription
inputStreamStreamThe input stream.
saveOptionsImageSaveOptionsImage save options.

Return Value

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);
}

See Also


ConvertToImages(Stream, LoadOptionsImageSaveOptions)

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)
ParameterTypeDescription
inputStreamStreamThe input stream.
loadOptionsLoadOptionsThe input document load options.
saveOptionsImageSaveOptionsImage save options.

Return Value

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);
}

See Also


ConvertToImages(DocumentSaveFormat)

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)
ParameterTypeDescription
docDocumentThe input document.
saveFormatSaveFormatSave format. Only image save formats are allowed.

Return Value

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);

See Also


ConvertToImages(DocumentImageSaveOptions)

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)
ParameterTypeDescription
docDocumentThe input document.
saveOptionsImageSaveOptionsImage save options.

Return Value

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);

See Also