After Migrating to .Net Core Lables are not getting bold.

1 Answer 120 Views
PdfProcessing
Shubhankar
Top achievements
Rank 1
Shubhankar asked on 17 Mar 2022, 01:09 PM | edited on 17 Mar 2022, 01:10 PM


public static void AddLabel(TableRow quartersRow1, string Label, alignment.HorizontalAlignment LabelAlignment = alignment.HorizontalAlignment.Right,  double Labelpreferwidth = 0, int labelColSpan = 1, double LabelFontSize = 10, bool ShowBorder = false)
        {
            TableCell Labelcell = quartersRow1.Cells.AddTableCell();
            Labelcell.PreferredWidth = Labelpreferwidth;
            Labelcell.ColumnSpan = labelColSpan;
            if (ShowBorder) Labelcell.Borders = new TableCellBorders(border, border, border, border);
            Block Lblock = Labelcell.Blocks.AddBlock();
            Lblock.HorizontalAlignment = LabelAlignment;
            Lblock.TextProperties.FontSize = LabelFontSize;
            Lblock.InsertText(genericfontfamily, FontStyles.Normal, FontWeights.Bold, Label ?? "");
            
        }


We have recently migrated our application from .Net framework to .Net Core. Earlier the label we used to print in the PDF were bold, but now since we have migrated the application the bold font is showing as normal font.

The code mentioned above was giving the bold fonts for the labels in the PDF.  

Can you please let me know what changes would be needed here for the desired output.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 21 Mar 2022, 09:52 AM

Hello Shubhankar,

You need to manually register the fonts because the Net Standard/Net Core version does not have access to the operating system and cannot get the fonts. Examples are available in the following articles: 

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
PdfProcessing
Asked by
Shubhankar
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or