public class Margins
extends java.lang.Object
Examples:
Shows when to recalculate the page layout of the document.
Document doc = new Document(getMyDir() + "Rendering.docx");
// Saving a document to PDF, to an image, or printing for the first time will automatically
// cache the layout of the document within its pages.
doc.save(getArtifactsDir() + "Document.UpdatePageLayout.1.pdf");
// Modify the document in some way.
doc.getStyles().get("Normal").getFont().setSize(6.0);
doc.getSections().get(0).getPageSetup().setOrientation(Orientation.LANDSCAPE);
doc.getSections().get(0).getPageSetup().setMargins(Margins.MIRRORED);
// In the current version of Aspose.Words, modifying the document does not automatically rebuild
// the cached page layout. If we wish for the cached layout
// to stay up to date, we will need to update it manually.
doc.updatePageLayout();
doc.save(getArtifactsDir() + "Document.UpdatePageLayout.2.pdf");
| Modifier and Type | Field and Description |
|---|---|
static int |
CUSTOM
Custom margins.
|
static int |
length |
static int |
MIRRORED
Mirrored margins.
|
static int |
MODERATE
Moderate margins.
|
static int |
NARROW
Narrow margins.
|
static int |
NORMAL
Normal margins.
|
static int |
WIDE
Wide margins.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String marginsName) |
static java.lang.String |
getName(int margins) |
static int[] |
getValues() |
static java.lang.String |
toString(int margins) |
public static int NORMAL
public static int NARROW
public static int MODERATE
public static int WIDE
public static int MIRRORED
Remarks:
Setting margins to Mirrored will set the appropriate value for PageSetup.getMultiplePages() / PageSetup.setMultiplePages(int) property. This will affect the whole document, not just the current section.
public static int CUSTOM
public static int length