Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.Words for Python via .NET allows users to export multi-page documents to raster images. This can be useful for generating previews, archives, or visual representations of documents for non-editable use.
Aspose.Words supports multi-page export to the following raster image formats:
The feature of exporting a multi-page document to an image is implemented using the MultiPageLayout class – you can specify how the pages should be organized when saving to an image:
The following code example shows how to save a multi-page DOCX document as JPEG image with Horizontal layout:
doc = aw.Document(file_name='Rendering.docx')
options = aw.saving.ImageSaveOptions(aw.SaveFormat.JPEG)
# Set up Horizontal layout.
options.page_layout = MultiPageLayout.Horizontal(10);
doc.save(file_name='ImageSaveOptions.GridLayout.jpg', save_options=options)
You can also customize the output file page appearance – specify back_color, border_color, and border_width.
The following code example shows how to save a multi-page DOCX document as PNG image with Grid layout:
doc = aw.Document(file_name='Rendering.docx')
options = aw.saving.ImageSaveOptions(aw.SaveFormat.PNG)
# Set up a grid layout with:
# - 3 columns per row.
# - 10pts spacing between pages (horizontal and vertical).
options.page_layout = aw.saving.MultiPageLayout.grid(3, 10, 10)
# Customize the background and border.
options.page_layout.back_color = aspose.pydrawing.Color.light_gray
options.page_layout.border_color = aspose.pydrawing.Color.blue
options.page_layout.border_width = 2
doc.save(file_name='ImageSaveOptions.GridLayout.jpg', save_options=options)
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.