Search results

PdfStandardFont API in JavaScript (ES5) Pdf Export API control

Represents one of the 14 standard fonts. It’s used to create a standard PDF font to draw the text in to the PDF.

// create a new PDF document
let document : PdfDocument = new PdfDocument();
// add a new page to the document
let page1 : PdfPage = document.pages.add();
//
// create new standard font
let font : PdfStandardFont = new PdfStandardFont(PdfFontFamily.Helvetica, 20);
//
// create black brush
let blackBrush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));
// draw the text
page1.graphics.drawString('Hello World', font, blackBrush, new PointF(0, 0));
// save the document
document.save('output.pdf');
// destroy the document
document.destroy();

Methods

getLineWidth

Returns width of the line.

Returns number