Aspose::Words::Saving::ImageSaveOptions::get_PageLayout method

ImageSaveOptions::get_PageLayout method

Gets or sets the layout used when rendering multiple pages into a single output.

System::SharedPtr<Aspose::Words::Saving::MultiPageLayout> Aspose::Words::Saving::ImageSaveOptions::get_PageLayout() const

Remarks

Use one of the factory methods of MultiPageLayout to configure this property.

For Tiff the default value is TiffFrames. For other formats the default value is SinglePage.

This property has effect only when saving to the following formats: Jpeg, Gif, Png, Bmp, Tiff, WebP

Examples

Shows how to save the document into JPG image with multi-page layout settings.

auto doc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Rendering.docx");

auto options = System::MakeObject<Aspose::Words::Saving::ImageSaveOptions>(Aspose::Words::SaveFormat::Jpeg);
// Set up a grid layout with:
// - 3 columns per row.
// - 10pts spacing between pages (horizontal and vertical).
options->set_PageLayout(Aspose::Words::Saving::MultiPageLayout::Grid(3, 10.0f, 10.0f));

// Alternative layouts:
// options.PageLayout = MultiPageLayout.Horizontal(10);
// options.PageLayout = MultiPageLayout.Vertical(10);

// Customize the background and border.
options->get_PageLayout()->set_BackColor(System::Drawing::Color::get_LightGray());
options->get_PageLayout()->set_BorderColor(System::Drawing::Color::get_Blue());
options->get_PageLayout()->set_BorderWidth(2.0f);

doc->Save(get_ArtifactsDir() + u"ImageSaveOptions.GridLayout.jpg", options);

See Also