English

How To: Programatically add a mapped font to a PDF export

Summary

Instructions provided describe how to take a TrueType font in the map and export it out to a mapped font using the code below.

Procedure

Make certain to specify the font to map. The following code can be used in conjunction with existing code used to export map to .pdf file.


Code:
'This section maps the TrueType Font to a Mapped Font
Dim pFME As IFontMapEnvironment
Set pFME = pExporter 'QI to already exisitng pExporter object

Dim pFMC As IFontMapCollection
Set pFMC = pFME.FontMapCollection

Dim pFont As IFontMap2
Set pFont = New FontMap

pFont.Mapping("Arial") = "Courier"

Debug.Print pFont.MappedFont

pFont.SetMapping "Arial", "Courier"
pFMC.Add pFont
Debug.Print pFMC.Count