MultiplePagesType

Inheritance: java.lang.Object

public class MultiplePagesType

Specifies how document is printed out.

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");
 

Fields

FieldDescription
BOOK_FOLD_PRINTINGSpecifies whether to print the document as a book fold.
BOOK_FOLD_PRINTING_REVERSESpecifies whether to print the document as a reverse book fold.
DEFAULTDefault value is NORMAL
MIRROR_MARGINSSwaps left and right margins on facing pages.
NORMALNormal printing, no multiple pages specified.
TWO_PAGES_PER_SHEETPrints two pages per sheet.
length

Methods

MethodDescription
fromName(String multiplePagesTypeName)
getName(int multiplePagesType)
getValues()
toString(int multiplePagesType)

BOOK_FOLD_PRINTING

public static int BOOK_FOLD_PRINTING

Specifies whether to print the document as a book fold.

BOOK_FOLD_PRINTING_REVERSE

public static int BOOK_FOLD_PRINTING_REVERSE

Specifies whether to print the document as a reverse book fold.

DEFAULT

public static int DEFAULT

Default value is NORMAL

MIRROR_MARGINS

public static int MIRROR_MARGINS

Swaps left and right margins on facing pages.

NORMAL

public static int NORMAL

Normal printing, no multiple pages specified.

TWO_PAGES_PER_SHEET

public static int TWO_PAGES_PER_SHEET

Prints two pages per sheet.

length

public static int length

fromName(String multiplePagesTypeName)

public static int fromName(String multiplePagesTypeName)

Parameters:

ParameterTypeDescription
multiplePagesTypeNamejava.lang.String

Returns: int

getName(int multiplePagesType)

public static String getName(int multiplePagesType)

Parameters:

ParameterTypeDescription
multiplePagesTypeint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int multiplePagesType)

public static String toString(int multiplePagesType)

Parameters:

ParameterTypeDescription
multiplePagesTypeint

Returns: java.lang.String