convert_to_images method

convert_to_images(input_file, output_file)

Converts the input file pages to images.

def convert_to_images(self, input_file: str, output_file: str):
    ...
ParameterTypeDescription
input_filestrThe input file name.
output_filestrThe output file name used to generate file name for page images using rule “outputFile_pageIndex.extension”

convert_to_images(input_file, output_file, save_format)

Converts the input file pages to images.

def convert_to_images(self, input_file: str, output_file: str, save_format: aspose.words.SaveFormat):
    ...
ParameterTypeDescription
input_filestrThe input file name.
output_filestrThe output file name used to generate file name for page images using rule “outputFile_pageIndex.extension”
save_formatSaveFormatSave format. Only image save formats are allowed.

convert_to_images(input_file, output_file, save_options)

Converts the input file pages to images.

def convert_to_images(self, input_file: str, output_file: str, save_options: aspose.words.saving.ImageSaveOptions):
    ...
ParameterTypeDescription
input_filestrThe input file name.
output_filestrThe output file name used to generate file name for page images using rule “outputFile_pageIndex.extension”
save_optionsImageSaveOptionsImage save options.

convert_to_images(input_file, load_options, output_file, save_options)

Converts the input file pages to images.

def convert_to_images(self, input_file: str, load_options: aspose.words.loading.LoadOptions, output_file: str, save_options: aspose.words.saving.ImageSaveOptions):
    ...
ParameterTypeDescription
input_filestrThe input file name.
load_optionsLoadOptionsThe input document load options.
output_filestrThe output file name used to generate file name for page images using rule “outputFile_pageIndex.extension”
save_optionsImageSaveOptionsImage save options.

convert_to_images(input_file, save_format)

Converts the input file pages to images.

def convert_to_images(self, input_file: str, save_format: aspose.words.SaveFormat):
    ...
ParameterTypeDescription
input_filestrThe input file name.
save_formatSaveFormatSave format. Only image save formats are allowed.

Returns

Returns array of image streams. The streams should be disposed by the enduser.

convert_to_images(input_file, save_options)

Converts the input file pages to images.

def convert_to_images(self, input_file: str, save_options: aspose.words.saving.ImageSaveOptions):
    ...
ParameterTypeDescription
input_filestrThe input file name.
save_optionsImageSaveOptionsImage save options.

Returns

Returns array of image streams. The streams should be disposed by the enduser.

convert_to_images(input_stream, save_format)

Converts the input stream pages to images.

def convert_to_images(self, input_stream: io.BytesIO, save_format: aspose.words.SaveFormat):
    ...
ParameterTypeDescription
input_streamio.BytesIOThe input stream.
save_formatSaveFormatSave format. Only image save formats are allowed.

Returns

Returns array of image streams. The streams should be disposed by the enduser.

convert_to_images(input_stream, save_options)

Converts the input stream pages to images.

def convert_to_images(self, input_stream: io.BytesIO, save_options: aspose.words.saving.ImageSaveOptions):
    ...
ParameterTypeDescription
input_streamio.BytesIOThe input stream.
save_optionsImageSaveOptionsImage save options.

Returns

Returns array of image streams. The streams should be disposed by the enduser.

convert_to_images(input_stream, load_options, save_options)

Converts the input stream pages to images.

def convert_to_images(self, input_stream: io.BytesIO, load_options: aspose.words.loading.LoadOptions, save_options: aspose.words.saving.ImageSaveOptions):
    ...
ParameterTypeDescription
input_streamio.BytesIOThe input stream.
load_optionsLoadOptionsThe input document load options.
save_optionsImageSaveOptionsImage save options.

Returns

Returns array of image streams. The streams should be disposed by the enduser.

convert_to_images(doc, save_format)

Converts the document pages to images.

def convert_to_images(self, doc: aspose.words.Document, save_format: aspose.words.SaveFormat):
    ...
ParameterTypeDescription
docDocumentThe input document.
save_formatSaveFormatSave format. Only image save formats are allowed.

Returns

Returns array of image streams. The streams should be disposed by the enduser.

convert_to_images(doc, save_options)

Converts the document pages to images.

def convert_to_images(self, doc: aspose.words.Document, save_options: aspose.words.saving.ImageSaveOptions):
    ...
ParameterTypeDescription
docDocumentThe input document.
save_optionsImageSaveOptionsImage save options.

Returns

Returns array of image streams. The streams should be disposed by the enduser.

Examples

Shows how to convert document to images.

aw.lowcode.Converter.convert_to_images(input_file=MY_DIR + 'Big document.docx', output_file=ARTIFACTS_DIR + 'LowCode.ConvertToImages.png')
aw.lowcode.Converter.convert_to_images(input_file=MY_DIR + 'Big document.docx', output_file=ARTIFACTS_DIR + 'LowCode.ConvertToImages.jpeg', save_format=aw.SaveFormat.JPEG)
image_save_options = aw.saving.ImageSaveOptions(aw.SaveFormat.PNG)
image_save_options.page_set = aw.saving.PageSet(page=1)
aw.lowcode.Converter.convert_to_images(input_file=MY_DIR + 'Big document.docx', output_file=ARTIFACTS_DIR + 'LowCode.ConvertToImages.png', save_options=image_save_options)

Shows how to convert document to images stream.

streams = aw.lowcode.Converter.convert_to_images(input_file=MY_DIR + 'Big document.docx', save_format=aw.SaveFormat.PNG)
image_save_options = aw.saving.ImageSaveOptions(aw.SaveFormat.PNG)
image_save_options.page_set = aw.saving.PageSet(page=1)
streams = aw.lowcode.Converter.convert_to_images(input_file=MY_DIR + 'Big document.docx', save_options=image_save_options)
streams = aw.lowcode.Converter.convert_to_images(doc=aw.Document(file_name=MY_DIR + 'Big document.docx'), save_format=aw.SaveFormat.PNG)
streams = aw.lowcode.Converter.convert_to_images(doc=aw.Document(file_name=MY_DIR + 'Big document.docx'), save_options=image_save_options)

See Also