Public enum to define a layout type for drawing
// Load an existing document
let document: PdfDocument = new PdfDocument(data);
// Access the first page
let page: PdfPage = document.getPage(0);
// Assign the array of string for items
let products: string[] = ['Excel', 'Power', 'Point', 'Word', 'PDF'];
// Add the items to the list item collection by passing the array
let items: PdfListItemCollection = new PdfListItemCollection(products);
// Create a new ordered list
let list: PdfOrderedList = new PdfOrderedList(items);
// Create a layout format for drawing
let pageLayout: PdfLayoutFormat = new PdfLayoutFormat();
// Initialize layout type for drawing
pageLayout.layout = PdfLayoutType.paginate;
// Draw the list on the page along with the specified layout
list.draw(page, 0, 20, 500, 700, pageLayout);
// Get the layout type used to draw the list
let layoutType: PdfLayoutType = pageLayout.layout;
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();
onePage
- Specifies content to be laid out to fit within a single page, without paginationpaginate
- Specifies pagination across multiple pages based on the specified dimensions and layout options