java.lang.Object
com.aspose.words.Margins
public class Margins
- extends java.lang.Object
Utility class containing constants.
Specifies preset margins.
Example:
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");
|
Field Summary |
static final int | NORMAL = 0 | |
|
Normal margins.
|
static final int | NARROW = 1 | |
|
Narrow margins.
|
static final int | MODERATE = 2 | |
|
Moderate margins.
|
static final int | WIDE = 3 | |
|
Wide margins.
|
static final int | MIRRORED = 4 | |
|
Mirrored margins.
|
static final int | CUSTOM = 5 | |
|
Custom margins.
|
NORMAL = 0 | |
public static final int NORMAL |
-
Normal margins.
NARROW = 1 | |
public static final int NARROW |
-
Narrow margins.
MODERATE = 2 | |
public static final int MODERATE |
-
Moderate margins.
WIDE = 3 | |
public static final int WIDE |
-
Wide margins.
MIRRORED = 4 | |
public static final int MIRRORED |
-
Mirrored margins.
Setting margins to Mirrored will set the appropriate value for PageSetup.MultiplePages property.
This will affect the whole document, not just the current section.
CUSTOM = 5 | |
public static final int CUSTOM |
-
Custom margins.
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.