Click or drag to resize
Pdftools logo

FontCreate Method

Create a new font object from font file data.

Supported formats are:
  • Type1
  • CFF
  • TrueType
  • OpenType
The returned font object is not yet used on any page, but it is associated with the given target document.

Namespace: PdfTools.Toolbox.Pdf.Content
Assembly: PdfTools.Toolbox (in PdfTools.Toolbox.dll) Version: 1.2.0+708f7116d933787a0712d56133e4c2c9bf21e5e3
Syntax
C#
public static Font Create(
	Document targetDocument,
	Stream stream,
	bool embedded
)

Parameters

targetDocument  Document
the output document with which the returned object is associated
stream  Stream
the font file data stream
embedded  Boolean
if the font shall be embedded in the document. Note that this parameter must be for PDF/A documents.

Return Value

Font
the newly created font object
Exceptions
ExceptionCondition
IOExceptionError reading from the font file or writing to the document
UnknownFormatExceptionThe font data has an unknown format
CorruptExceptionThe font data is corrupt
ConformanceExceptionParameter embedded is for PDF/A document
ArgumentExceptionif the targetDocument argument has already been closed
ArgumentExceptionif the targetDocument argument is read-only
ArgumentExceptionif the stream argument is
ArgumentNullExceptionif targetDocument is .
ArgumentNullExceptionif stream is .
See Also