Persits Software, Inc. Web Site
 Navigator:  Home |  Object Reference |  PdfFonts
PdfForm PdfFont
  PdfFonts Object
PdfFonts is a collection of PdfFont objects obtainable via PdfDocument's Fonts property. The PdfFonts collection can be used to obtain standard PDF fonts, as well as non-standard fonts installed on the machine. This object also makes it possible to load TrueType/OpenType fonts directly from their .TTF or .OTF files. For more information about font management, see Section 6.2 - Font Management.

Properties Methods
Count
Item
LoadFromFile

Properties


Count As Long (Read-only)

Returns the current number of PdfFont objects in the collection. Initially, the PdfFonts collection is empty and this property returns 0.

Item ( Index As Variant, Optional CharSet ) As PdfFont (Read-only)

This is the default parameterized property returning a PdfFont object specified either by a 1-based integer index, or by font name.

If Index is an integer between 1 and Count, this property returns a PdfFont with the specified index.

If Index is a string, there are two possibilities:


Methods

Function LoadFromFile ( Path As String ) As PdfFont
Loads a TrueType or OpenType font directly from a .ttf or .otf file specified by Path. The font does not have to be properly installed on the machine (i.e. appear in the Fonts control panel).

As of Version 2.9.0.1, .ttc files (TrueType collections) are supported as well. By default, the very first font in the collection is loaded. A 1-based font index can optionally be appended to the path, separated by a comma.

Usage:

Set Font = Doc.Fonts.LoadFromFile("c:\windows\fonts\arial.ttf")

Set Font = Doc.Fonts.LoadFromFile("c:\windows\fonts\gulim.ttc")

Set Font = Doc.Fonts.LoadFromFile("c:\windows\fonts\gulim.ttc,3")

For more information about font management, see Section 6.2 - Font Management.


PdfForm PdfFont
Search AspPDF.com

  This site is owned and maintained by Persits Software, Inc. Copyright © 2003. All Rights Reserved.