Embeds a font into the document.

 

   
Syntax
 
     

FontID = Doc.EmbedFont(FontName [,Language[, Vertical[, Subset]]])

 

   
Params
 
     
Name   Type   Description
FontName String The name of the font typeface.
Language String

The language type to use (optional).

See the Fonts and Languages section for details on language types. The default language type is Latin.

Vertical Boolean

Whether the text direction should be vertical (optional).

See the Fonts and Languages section for details on writing directions. The default is false to indicate standard left to right layout.

Subset Boolean

Whether to subset the font (optional).

See the Fonts and Languages section for details on subsetting. The default is false to indicate that the font should not be subsetted.

FontID Long The Object ID of the newly added Font Object.

 

   
Notes
 
     

Embeds a font into the document.

The font name, a description of the font style and the the font glyph descriptions themselves are placed into the document. This ensures that the document will always display perfectly on every system and that font substitutions will never need to be made.

There are a number of reasons you may not wish to embed fonts and instead use the AddFont method. Embedding fonts can increase the size of your PDF considerably. Additionally by distributing a PDF with an embedded font you are actually redistributing the font itself. You should check with your font supplier or legal department that you have permission to do this.

For information on how to specify font names see the AddFont method.

The EmbedFont function returns the Object ID of the newly added Font Object. Typically you will want to assign this return value to the document Font property using code of the form.

theDoc.Font = theDoc.AddFont("Courier")

 

   
Example
 
     

The following code embeds the font 'Comic Sans MS' into the document and then adds some text.

Set theDoc = Server.CreateObject("ABCpdf3.Doc")
theDoc.FontSize = 216
theFont = "Comic Sans MS"
theDoc.Font = theDoc.EmbedFont(theFont)
theDoc.AddText theFont
theDoc.Save "c:\mypdfs\docembedfont.pdf
"


docembedfont.pdf

   

 

Browser Based Help. Published by chm2web software.