Click or drag to resize
Pdf Library for .NET

PdfFontCreateStandardFont Method

Creates a PdfFont from a standard PDF font family and size.

Namespace: SelectPdf.Universal
Assembly: SelectPdf.HtmlToPdf.Universal (in SelectPdf.HtmlToPdf.Universal.dll) Version: 26.4
Syntax
public static PdfFont CreateStandardFont(
	PdfStandardFont fontFamily,
	float size
)

Parameters

fontFamily  PdfStandardFont
The standard font family.
size  Single
The font size in points.

Return Value

PdfFont
A new PdfFont instance.
Remarks
The font is referenced by name, not embedded into the output document. This is the smallest / fastest choice for regular PDFs but is rejected under PDF/A and PDF/X conformance (which require every font to be embedded as TrueType/OpenType). For conformant output from scratch use CreateFromFile(String, Single) / CreateFromStream(Stream, Single) / CreateFromBytes(Byte, Single) with an actual .ttf / .otf file.
Example
PdfFont font =
    PdfFont.CreateStandardFont(PdfStandardFont.HelveticaBold, 14f);
See Also