This sample shows how to draw text using different fonts. Read More
Out of the box PdfDocument supports the following fonts: Courier, Helvetica, Times, Symbol, ZapfDingbats. The first three fonts have four typefaces each, "normal", "bold", "oblique" and "bold oblique". This gives us a set of fonts known as "14 Standard PDF fonts".
The PdfFont class describes a particular font and its constructor accepts the following arguments:
The following instance is the default document font in terms of PdfDocument:
new wijmo.pdf.PdfFont("times", 10, "normal", "normal")
In PdfDocument, the font can be specified in two ways:
doc.drawText("Lorem", null, null, {
font: new wijmo.pdf.PdfFont("times", 10, "normal", "bold")
});
doc.setFont(new wijmo.pdf.PdfFont("times", 10, "normal", "bold"));
doc.drawText("Lorem");
If font with exact given style and weight properties is not found, then the closest registered font will be used.
This sample shows how to use drawText and doc.setFont methods to draw text using different fonts.