Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.Words cho Python via .NET cho phép người dùng xuất tài liệu nhiều trang sang hình ảnh raster. Điều này có thể hữu ích để tạo bản xem trước, lưu trữ hoặc biểu diễn trực quan các tài liệu để sử dụng không thể chỉnh sửa.
Aspose.Words hỗ trợ xuất nhiều trang sang các định dạng hình ảnh raster sau:
Tính năng xuất tài liệu nhiều trang sang hình ảnh được triển khai bằng lớp MultiPageLayout-bạn có thể chỉ định cách tổ chức các trang khi lưu vào hình ảnh:
Ví dụ mã sau đây cho thấy cách lưu tài liệu DOCX nhiều trang dưới dạng hình ảnh JPEG với bố Cục Ngang:
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)
Bạn cũng có thể tùy chỉnh giao diện trang tệp đầu ra – chỉ định back_color, border_color và border_width.
Ví dụ mã sau đây cho thấy cách lưu tài liệu DOCX nhiều trang dưới dạng hình ảnh PNG với Bố Cục Lưới:
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.