Aspose::Words::Saving::MultiPageLayout class

MultiPageLayout class

Defines a layout for rendering multiple pages into a single output.

class MultiPageLayout : public System::Object

Methods

MethodDescription
get_BackColor()Gets the background color of the output. The default is Empty.
get_BorderColor()Gets the color of the pages border. The default is Empty.
get_BorderWidth() constGets the width of the pages border. The default is 0.
GetType() const override
static Grid(int32_t, float, float)Creates a layout in which pages are rendered left-to-right, top-to-bottom, in a grid with the specified number of columns.
static Horizontal(float)Creates a layout in which all specified pages are rendered horizontally side by side, left to right, in a single output.
Is(const System::TypeInfo&) const override
set_BackColor(System::Drawing::Color)Sets the background color of the output. The default is Empty.
set_BorderColor(System::Drawing::Color)Sets the color of the pages border. The default is Empty.
set_BorderWidth(float)Sets the width of the pages border. The default is 0.
static SinglePage()Creates a layout that renders only the first of specified pages.
static TiffFrames()Creates a layout where each page is rendered as a separate frame in a multi-frame TIFF image. Applicable only to TIFF image formats.
static Type()
static Vertical(float)Creates a layout where all specified pages are rendered vertically one below the other in a single output.

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