Welcome to the ASP.NET Core feedback portal. We’re happy you’re here! If you have feedback on how to improve the ASP.NET Core, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

0
Votes

While set the RTF text in the text box control the specified Alignment is not working. This issue included in both base and portable. In the ASP.NET Core, the exception “System.ArgumentException: ''Windows-1252' is not a supported encoding name.'” throws while set the RTF text in the textbox. So we have to fix these issues in both portable and base projects.


Code Snippet:
            ExcelEngine excel = new ExcelEngine();
            var application = excel.Excel;
            application.DefaultVersion = ExcelVersion.Excel2010;
            var workbook = application.Workbooks.Create(1);
            var sheet = workbook.Worksheets[0];

            var textBox = sheet.TextBoxes.AddTextBox(2, 2, 100, 200);
            textBox.RichText.RtfText = @"{\rtf1\ansi\ansicpg1250\deff0\nouicompat\deflang1029{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}}
\viewkind4\uc1 \pard\qc\f0\fs20 One paragraph.}";

            var textBox2 = sheet.TextBoxes.AddTextBox(10, 2, 100, 200);
            textBox2.RichText.RtfText = @"{\rtf1\ansi\ansicpg1250\deff0\nouicompat\deflang1029{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}}
\viewkind4\uc1 
\pard\qc\f0\fs20 First paragraph.\par
Second paragraph.\par
Third paragraph.\par}";

            using (FileStream fs = File.Create(outputFilename))
            {
                workbook.SaveAs(fs);
            }
            Process.Start(outputFilename);