HelpBot Assistant

How can I help you?

PdfLayoutFormat

6 Feb 20262 minutes to read

Represent the layout format class for pagination
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data);
// Access the first page
let page: PdfPage = document.getPage(0);
// Create an instance of list item collection by passing the string array
let items: PdfListItemCollection = new PdfListItemCollection([‘Excel’, ‘Power’, ‘Point’, ‘Word’, ‘PDF’]);
// Create a new PDF ordered list
let list: PdfOrderedList = new PdfOrderedList(items);
// Create an instance for PDF layout format
let layout: PdfLayoutFormat = new PdfLayoutFormat();
// Set the layout format
layout.break = PdfLayoutBreakType.fitPage;
layout.layout = pdfLayoutType.paginate;
// Draw the items using specified bounds and layout format
list.draw(page, {x: 0, y: 20}, layout);
// Save the document
document.save(‘output.pdf’);
// Destroy the document
document.destroy();
```

Properties

Get break PdfLayoutBreakType

Gets the layout break type of the page.

Set break void

Sets the layout break type for the page.

Parameter Type Description
value PdfLayoutBreakType The layout break type to set for the page.

Get layout PdfLayoutType

Gets the layout type of the page.

Set layout void

Sets the layout type of the page.

Parameter Type Description
value PdfLayoutType The layout type of the page.

Get paginateBounds Rectangle

Gets the paginate bounds of the page.

Set paginateBounds void

Sets the paginate bounds for the page.

Parameter Type Description
value Rectangle The paginate bounds to set for the page.

Get usePaginateBounds boolean

Gets whether to use paginate bounds for pagination.