How can I apply Poppins Font on full document?

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v11)  /  How can I apply Poppins Font on full document?

DynamicPDF CoreSuite for .NET (v11) Forum

How can I apply Poppins Font on full document?
Can I import font from packages?
Posted by a ceTe Software moderator
Hello,

You can embed any OTF or TTF fonts using the OpenTypeFont class. You will then specify this font object in your page elements (Label, TextArea, etc.). Please refer to the documentation on fonts and text here.

Here is a code sample to embed a font in a document.

           Document document = new Document();
            Page page = new Page();
            document.Pages.Add(page);

            OpenTypeFont myFont = new OpenTypeFont("OTF or TTF font file path");
            fontObj.Embed = true;
            fontObj.Subset = false;
            TextArea area1 = new TextArea("Test to add font", 0, 50, 200, 50, myFont, 12);
            page.Elements.Add(area1);
            document.Draw(@"Path to save the document");

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 11:53 PM.