Search results

PdfList API in JavaScript PDF API control

Represents base class for lists.

// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data);
// Access the first page
let page: PdfPage = document.getPage(0);
// Assign the array of string items
let products: string[] = ['Excel', 'Power', 'Point', 'Word', 'PDF'];
// Initialize a new brush
let brush: PdfBrush =  new PdfBrush([0, 255, 255])
// Add an item to item collection by passing the string array
let items: PdfListItemCollection = new PdfListItemCollection(products);
// Create a new instance of ordered list
let list: PdfList = new PdfOrderedList(items);
// Draw the ordered list with specified items
list.draw(page, 0, 20, 500, 700);
// Get the brush associated with the ordered list
let listBrush: PdfBrush = list.brush;
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();

Properties

alignment PdfListMarkerAlignment

Gets the text alignment of the list.

brush PdfBrush

Gets the PdfBrush object associated with the list.

delimiter string

Gets the delimiter string used to separate items in the list.

enableHierarchy boolean

Gets a value indicating whether hierarchical structure is enabled for the list.

font PdfFont

Gets the font of the list item.

indent number

Gets the indent of the list.

items PdfListItemCollection

Gets the item collection of the list.

pen PdfPen

Gets the PdfPen object associated with the list.

stringFormat PdfStringFormat

Gets the text layout format associated with the list item.

textIndent number

Gets the text indent of the list.

Methods

draw

Draws the content on the specified PdfPage at the given coordinates.

Parameter Type Description
page PdfPage The PDF page on which to draw the content.
x number The x-coordinate where the list will be drawn.
y number The y-coordinate where the list will be drawn.

Returns PdfLayoutResult

draw

Draws the PdfList at the specified coordinates on the PdfGraphics context.

Parameter Type Description
graphics PdfGraphics The graphics context on which to draw the list.
x number The x-coordinate where the list will be drawn.
y number The y-coordinate where the list will be drawn.

Returns void

draw

Draws the content on the specified PdfPage at the given coordinates with the specified layout format.

Parameter Type Description
page PdfPage The PDF page on which to draw the content.
x number The x-coordinate where the list will be drawn.
y number The y-coordinate where the list will be drawn.
format PdfLayoutFormat The layout format options for drawing.

Returns PdfLayoutResult

draw

Draws the content on the specified PdfPage within the specified bounds.

Parameter Type Description
page PdfPage The PDF page on which to draw the content.
x number The x-coordinate where the list will be drawn.
y number The y-coordinate where the list will be drawn.
width number The width of the area to draw within.
height number The height of the area to draw within.

Returns PdfLayoutResult

draw

Draws the content on the specified PdfPage at the given bounds with the specified layout format.

Parameter Type Description
page PdfPage The PDF page on which to draw the content.
x number The x-coordinate where the list will be drawn.
y number The y-coordinate where the list will be drawn.
width number The width of the area to draw within.
height number The height of the area to draw within.
format PdfLayoutFormat The layout format options for drawing.

Returns PdfLayoutResult