text()

This method is used to insert text.

text(text, x, y, options)

Here, x and y is the horizontal and vertical position where the text will be written. text is the text which will be inserted to the document. Here the text can be array of string if you want to render multiline text.

doc.text("Hello World", 10, 10);
doc.text(['Santanu Bera', 'Atanu Bera', 'Sumita Bera', 'Aloke Bera'], 10, 10);

setFontSize()

This method is used to set the font size of the text.

doc.setFontSize(20);

setFontStyle()

This method is used to set the font style of the text. Possible values are -

doc.setFontStyle("italic");
doc.setFontStyle("bolditalic");

setTextColor()

This method is used to set the font or text color.

doc.setTextColor(red, blue, green);

For example -

doc.setTextColor(125, 76, 76);