Unplanned
Last Updated: 27 Oct 2020 09:56 by ADMIN
René
Created on: 26 Oct 2020 09:08
Category: PdfProcessing
Type: Feature Request
10
Block.InsertText should not ignore newlines.

or there should be an optional parameter "bool AcceptNewlines" or "bool IgnoreNewlines"

 

Currently, this can be implemented like this:

private void InsertTextWithNewlines(Block block, string text)
{
    string[] lines = text.Split(new[] {"\r\n", "\r", "\n"}, StringSplitOptions.None);

    for (int i = 0; i < lines.Length; i++)
    {
       block.InsertText(lines[i]);
       if (i < lines.Length - 1)
       {
          block.InsertLineBreak();
       }
    }
}

1 comment
ADMIN
Dimitar
Posted on: 27 Oct 2020 09:56

Hi Rene,

Indeed we can implement such behavior. I have updated the item to include your workaround from the forum and I have updated your Telerik points.

Let me know if you have any other questions.

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/.