public class MultiplePagesType
extends java.lang.Object
Examples:
Shows how to configure a document that can be printed as a book fold.
Document doc = new Document();
// Insert text that spans 16 pages.
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("My Booklet:");
for (int i = 0; i < 15; i++) {
builder.insertBreak(BreakType.PAGE_BREAK);
builder.write(MessageFormat.format("Booklet face #{0}", i));
}
// Configure the first section's "PageSetup" property to print the document in the form of a book fold.
// When we print this document on both sides, we can take the pages to stack them
// and fold them all down the middle at once. The contents of the document will line up into a book fold.
PageSetup pageSetup = doc.getSections().get(0).getPageSetup();
pageSetup.setMultiplePages(MultiplePagesType.BOOK_FOLD_PRINTING);
// We can only specify the number of sheets in multiples of 4.
pageSetup.setSheetsPerBooklet(4);
doc.save(getArtifactsDir() + "PageSetup.Booklet.docx");
| Modifier and Type | Field and Description |
|---|---|
static int |
BOOK_FOLD_PRINTING
Specifies whether to print the document as a book fold.
|
static int |
BOOK_FOLD_PRINTING_REVERSE
Specifies whether to print the document as a reverse book fold.
|
static int |
DEFAULT
Default value is
NORMAL |
static int |
length |
static int |
MIRROR_MARGINS
Swaps left and right margins on facing pages.
|
static int |
NORMAL
Normal printing, no multiple pages specified.
|
static int |
TWO_PAGES_PER_SHEET
Prints two pages per sheet.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String multiplePagesTypeName) |
static java.lang.String |
getName(int multiplePagesType) |
static int[] |
getValues() |
static java.lang.String |
toString(int multiplePagesType) |
public static int NORMAL
public static int MIRROR_MARGINS
public static int TWO_PAGES_PER_SHEET
public static int BOOK_FOLD_PRINTING
public static int BOOK_FOLD_PRINTING_REVERSE
public static int DEFAULT
NORMALpublic static int length