public class MultiPageLayout
extends java.lang.Object
Remarks:
Use one of the static factory methods to create a layout configuration.
Examples:
Shows how to save the document into JPG image with multi-page layout settings.
Document doc = new Document(getMyDir() + "Rendering.docx");
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.JPEG);
// Set up a grid layout with:
// - 3 columns per row.
// - 10pts spacing between pages (horizontal and vertical).
options.setPageLayout(MultiPageLayout.grid(3, 10f, 10f));
// Alternative layouts:
// options.PageLayout = MultiPageLayout.Horizontal(10);
// options.PageLayout = MultiPageLayout.Vertical(10);
// Customize the background and border.
options.getPageLayout().setBackColor(Color.lightGray);
options.getPageLayout().setBorderColor(Color.BLUE);
options.getPageLayout().setBorderWidth(2f);
doc.save(getArtifactsDir() + "ImageSaveOptions.GridLayout.jpg", options);
| Modifier and Type | Method and Description |
|---|---|
java.awt.Color |
getBackColor()
Gets the background color of the output.
|
java.awt.Color |
getBorderColor()
Gets the color of the pages border.
|
float |
getBorderWidth()
Gets the width of the pages border.
|
static MultiPageLayout |
grid(int columns,
float horizontalGap,
float verticalGap)
Creates a layout in which pages are rendered left-to-right, top-to-bottom, in a grid with the specified number of columns.
|
static MultiPageLayout |
horizontal(float horizontalGap)
Creates a layout in which all specified pages are rendered horizontally side by side, left to right, in a single output.
|
void |
setBackColor(java.awt.Color value)
Sets the background color of the output.
|
void |
setBorderColor(java.awt.Color value)
Sets the color of the pages border.
|
void |
setBorderWidth(float value)
Sets the width of the pages border.
|
static MultiPageLayout |
singlePage()
Creates a layout that renders only the first of specified pages.
|
static MultiPageLayout |
tiffFrames()
Creates a layout where each page is rendered as a separate frame in a multi-frame TIFF image.
|
static MultiPageLayout |
vertical(float verticalGap)
Creates a layout where all specified pages are rendered vertically one below the other in a single output.
|
public static MultiPageLayout vertical(float verticalGap)
verticalGap - The vertical gap between pages in points.public static MultiPageLayout horizontal(float horizontalGap)
horizontalGap - The horizontal gap between pages in points.public static MultiPageLayout grid(int columns, float horizontalGap, float verticalGap)
columns - The number of columns in the layout. Must be greater than zero.horizontalGap - The horizontal gap between columns in points.verticalGap - The vertical gap between rows in points.java.lang.IllegalArgumentException - Thrown if columns is less than or equal to zero.public static MultiPageLayout tiffFrames()
public static MultiPageLayout singlePage()
public java.awt.Color getBackColor()
java.awt.Color#EMPTY.public void setBackColor(java.awt.Color value)
java.awt.Color#EMPTY.value - The background color of the output.public java.awt.Color getBorderColor()
java.awt.Color#EMPTY.public void setBorderColor(java.awt.Color value)
java.awt.Color#EMPTY.value - The color of the pages border.public float getBorderWidth()
public void setBorderWidth(float value)
value - The width of the pages border.