- C# Print document | Code Sample | Tall Components PDF C# samples
- Change colors of black-and-white TIFF after converting from PDF
- Convert multiple PDF pages to bitmap
- Convert PDF to an image using a dither matrix
- Convert PDF to JPG in C#
- Convert PDF to multipage TIFF in C# .NET
- Convert PDF to PNG using WPF
- Convert PDF to XPS
- Convert PDF with layers to image
- Display PDF in a WPF app and stay responsive - the code
- Font mapping
- PDF to grayscale TIFF C#
- C# Print PDF documents from a WPF application
- Render a PDF to bitmap
- Render PDF with ResolveFont event handler
- Render PDF to EMF
- Use multiple licenses
- How to use a system font for rendering text
Font mapping
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.
Page page = document.Pages[0];
// get a bitmap 4 time the size of the page. This is 288 DPI, almost 300
Bitmap bmp = new Bitmap((int) page.Width * 4, (int) page.Height * 4);
using (Graphics graphics = Graphics.FromImage(bmp))
{
graphics.ScaleTransform(4.0f, 4.0f);
renderSettings = new RenderSettings();
renderSettings.TextSettings.FontSubstitutionMap.Add("TallComponents Demo Font", "ariali.ttf");
page.Draw(graphics, renderSettings);
}