Font mapping

Fonts
8/24/2015

If you have a PDF document which uses non-embedded fonts, you can specify your own font substitution map to specify which fonts need to be used. Simply create a new RenderSettings object and add your substitution to it and use the object when rendering your document.

1 Page page = document.Pages[0]; 2 // Get a bitmap 4 time the size of the page. This is 288 DPI, almost 300 3 bmp1 = new Bitmap( (int) page.Width * 4, (int) page.Height * 4 ); 4 using ( Graphics graphics = Graphics.FromImage( bmp1 ) ) 5 { 6 graphics.ScaleTransform( 4.0f, 4.0f ); 7 renderSettings1 = new RenderSettings(); 8 renderSettings1.TextSettings.FontSubstitutionMap.Add( "TallComponents Demo Font", "ariali.ttf" ); 9 page.Draw( graphics, renderSettings1 ); 10 }