 | FontCreateFromSystem Method |
Create a new font object from an installed font.
The returned font object is not yet used on any page, but it is associated with the given target document.
Namespace: PdfTools.Toolbox.Pdf.ContentAssembly: PdfTools.Toolbox (in PdfTools.Toolbox.dll) Version: 1.2.0+708f7116d933787a0712d56133e4c2c9bf21e5e3
Syntaxpublic static Font CreateFromSystem(
Document targetDocument,
string family,
string style,
bool embedded
)
Parameters
- targetDocument Document
-
the output document with which the returned object is associated
- family String
-
the font family name (e.g. "Arial")
- style String
-
the font style (e.g. "Bold")
- 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
ExceptionsException | Condition |
---|
NotFoundException | There is no such font installed |
IOException | Error reading the font file or writing to the document |
UnknownFormatException | The font data has an unknown format |
CorruptException | The font data is corrupt |
ConformanceException | Parameter embedded is for PDF/A document |
ArgumentException | if the targetDocument argument has already been closed |
ArgumentException | if the targetDocument argument is read-only |
ArgumentException | if the family argument is |
ArgumentNullException | if targetDocument is . |
See Also