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


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


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.

'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

Last Published: 5/5/2016

Article ID: 000006324

Software: ArcGIS-ArcEditor 9.3.1, 9.3, 9.2, 9.1, 9.0, 8.3 ArcGIS-ArcInfo 9.3.1, 9.3, 9.2, 9.1, 9.0, 8.3 ArcGIS-ArcView 9.3.1, 9.3, 9.2, 9.1, 9.0, 8.3