Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.Words cho .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:
Document doc = new Document("Rendering.docx");
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Jpeg);
// Set up Horizontal layout.
options.PageLayout = MultiPageLayout.Horizontal(10);
doc.Save("ImageSaveOptions.HorizontalLayout.jpg", options);
Bạn cũng có thể tùy chỉnh giao diện trang tệp đầu ra – chỉ định BackColor, BorderColor và BorderWidth.
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:
Document doc = new Document("Rendering.docx");
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Png);
// Set up a grid layout with:
// - 3 columns per row.
// - 10pts spacing between pages (horizontal and vertical).
options.PageLayout = MultiPageLayout.Grid(3, 10, 10);
// Customize the background and border.
options.PageLayout.BackColor = Color.LightGray;
options.PageLayout.BorderColor = Color.Blue;
options.PageLayout.BorderWidth = 2;
doc.Save("ImageSaveOptions.GridLayout.png", options);
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.