Completed
Last Updated: 13 Nov 2024 08:03 by ADMIN
Release 2024.4.1106 (Q4 2024)
When exporting a document containing a table with no cells an exception is thrown: System.InvalidOperationException: 'Sequence contains no elements'
Completed
Last Updated: 13 Nov 2024 08:50 by ADMIN
Release 2024.4.1106 (Q4 2024)
ArgumentException is thrown during MailMerge with a document with inline shape in its header/footer.
Completed
Last Updated: 13 Nov 2024 08:02 by ADMIN
Release 2024.4.1106 (Q4 2024)
ADMIN
Created by: Peshito
Comments: 0
Category: WordsProcessing
Type: Bug Report
0
Exporting documents to with headings to RTF does not properly export some heading colors in the document.
Completed
Last Updated: 13 Nov 2024 08:49 by ADMIN
Release 2024.4.1106 (Q4 2024)
IndexOutOfRangeException is thrown when importing a specific document.
Completed
Last Updated: 02 Aug 2024 11:09 by ADMIN
Release 2024.3.802 (2024 Q3)

Latest version 2024.2.426:

Old version 2022.3.906:

Use the following code: 

        static void Main(string[] args)
        {
            Console.WriteLine("Test from 2022.3.906 to 2024.2.426.");
            string html = @"<html>
                <head>
                    <style type=""text/css"">
                            h1 {
                               background-color: red;
                              }
                            #highlight1{
                                background-color: blue;
                             }
                           .highlight2{
                                background-color: yellow;
                             }
                     </style>
                </head>
                <body>
                   <h1>H1 - This Works </h1>
                   <h2 id=""highlight1"">H2 with id selector.  This works too.</h2>
                   <h3 class=""highlight2"">H3 with class selector.  This didn't work</h3>
                </body>
                </html>";

            Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlFormatProvider html_provider = new Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlFormatProvider();
            RadFlowDocument document = html_provider.Import(html);

            string html_output = "output.html";
            using (Stream output = File.Create(html_output))
            {

                html_provider.Export(document, output);
            }
            Process.Start(new ProcessStartInfo() { FileName = html_output, UseShellExecute = true });
        }
Completed
Last Updated: 02 Aug 2024 11:08 by ADMIN
Release 2024.3.802 (2024 Q3)

When importing a RTF document with bullet lists and exporting the RadFlowDocument back to RTF format the following result is observed:

- the bullet's left offset is changed

- the bullets color is also changed

Workaround: use the Telerik.Windows.Documents.FormatProviders.Rtf.RtfFormatProvider available in the Telerik.Windows.Documents.FormatProviders.Rtf.dll

Completed
Last Updated: 02 Aug 2024 11:09 by ADMIN
Release 2024.3.802 (2024 Q3)

In a WPF project targeting .NET 6, the following code snippet results in an error:

        public MainWindow()
        {
            InitializeComponent();

            Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlFormatProvider provider = new Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlFormatProvider();
            RadFlowDocument document = provider.Import("<html><body><h1>My First Heading</h1><p>My first paragraph.</p></body></html>");
        }
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Text.Encoding.CodePages, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.'

Workaround: edit the .csproj file and include the required package reference:

	<ItemGroup>
		<PackageReference Include="Telerik.Windows.Documents.Flow" Version="2024.2.426" />
		<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
	</ItemGroup>
	<ItemGroup>
		<FunctionsPreservedDependencies Include="System.Text.Encoding.CodePages.dll" />
	</ItemGroup>

 

 
Completed
Last Updated: 02 Aug 2024 11:08 by ADMIN
Release 2024.3.802 (2024 Q3)
StartingPageNumber for PageField is not respected for sections other than the first one.
Completed
Last Updated: 02 Aug 2024 11:08 by ADMIN
Release 2024.3.802 (2024 Q3)
After successful importing of DOCX with ordered list of TOC, try exporting it to PDF format. 
Completed
Last Updated: 15 May 2024 06:27 by ADMIN
Release 2024.2.426 (2024 Q2)
NullReferenceException caused by a Hyperlink Field during nested Mail Merge.
Completed
Last Updated: 21 Mar 2024 05:53 by ADMIN
Release 2024.1.305 (2024 Q1)

Styles with names only different in spaces are treated as one.

Workaround:

var rtf = File.ReadAllText(fileName);
rtf = this.RenameStyleDifferentInOnlySpaces(rtf);
var document = provider.Import(rtf);

...

private string RenameStyleDifferentInOnlySpaces(string rtf)
{
    HashSet<string> styles = new HashSet<string>();

    string pattern = @"{\\(?:\*\\c)?s([0-9]+)[^}]*\n?[^}]*\\[^' ]* ?'?([^;]*)";

    var matches = Regex.Matches(rtf, pattern);
    foreach (Match match in matches)
    {
        string styleName = match.Groups[2].Value.Replace(" ", string.Empty);
        if (styles.Contains(styleName))
        {
            styleName = this.ReplaceOldStyleName(ref rtf, styles, match).Replace(" ", string.Empty);
        }

        styles.Add(styleName);
    }

    return rtf;
}

private string ReplaceOldStyleName(ref string rtf, HashSet<string> styles, Match match)
{
    string oldStyleName = match.Groups[2].Value;
    StringBuilder styleNameBuilder = new StringBuilder(oldStyleName + "0");
    while (styles.Contains(styleNameBuilder.ToString().Replace(" ", string.Empty)))
    {
        styleNameBuilder.Append("0");
    }

    string oldMatch = match.Groups[0].Value;
    string newMatch = oldMatch.Replace(oldStyleName, styleNameBuilder.ToString());
    rtf = rtf.Replace(oldMatch, newMatch);
    return styleNameBuilder.ToString();
}

Completed
Last Updated: 14 Mar 2024 08:59 by ADMIN
Release 2024.1.305 (2024 Q1)

StackOverflowException when importing a document with style based on itself.

Use the following code to strip the faulty "based on" definition from the RTF:

RtfFormatProvider provider = new RtfFormatProvider();
var rtf = File.ReadAllText(ofd.FileName);
rtf = this.ReplaceSelfBasedOnStyle(rtf);
this.flowDocument = provider.Import(rtf);

...

private string ReplaceSelfBasedOnStyle(string rtf)
{
    string pattern = @"{[\n]*\\s[0-9]+[^;]* \\\w* (Normal);}";

    var matches = Regex.Matches(rtf, pattern);
    foreach (Match match in matches)
    {
        string oldValue = match.Value;
        string newValue = oldValue.Replace(@"\sbasedon0 ", string.Empty);

        rtf = rtf.Replace(oldValue, newValue);
    }

    return rtf;
}

Completed
Last Updated: 14 Mar 2024 08:59 by ADMIN
Release 2024.1.305 (2024 Q1)
HtmlFormatProvider: Paragraph property AutomaticSpacingBefore is set to true instead of false.
Completed
Last Updated: 02 Aug 2024 11:09 by ADMIN
Release 2024.3.802 (2024 Q3)
DocFormatProvider: EndOfStreamException when importing document with specific image.
Completed
Last Updated: 21 Mar 2024 05:53 by ADMIN
Release 2024.1.305 (2024 Q1)

Handle import of documents with self-referring styles.

As a workaround, you can go through the RTF document structure of a single file and utilize Regex to resolve the self-referring styles like this:

string rtf = File.ReadAllText("inputFile.rtf");
rtf = FixSelfReferringStyles(rtf);

Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider provider = new Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider(); 

 var document = provider.Import(rtf);

...

private static string FixSelfReferringStyles(string rtf)
{
    string regexString = @"{\\s([0-9]+)[^}]*\\slink([0-9]+)";

    var matches = Regex.Matches(rtf, regexString);
    foreach (Match match in matches)
    {
        if (match.Groups[1].Value == match.Groups[2].Value)
        {
            var oldValue = match.Groups[0].Value;
            var newValue = oldValue.Replace(@" \slink" + match.Groups[1].Value, string.Empty);
            rtf = rtf.Replace(oldValue, newValue);
        }
    }

    return rtf;
}

 

Completed
Last Updated: 11 Jan 2024 08:24 by ADMIN
Release 2024 Q1
PdfFormatProvider: Inline image surrounded by bookmarks is incorrectly measured when the document contains numbering fields.
Completed
Last Updated: 12 Oct 2023 14:31 by ADMIN
Release R3 2023 SP1

When mailmerging a document, with nested mail merge group which starts inside a table and ends outside the table, a NullReferenceException is thrown: "System.NullReferenceException: 'Object reference not set to an instance of an object.' firstParagraphInTemplate was null."

Workaround: move the group end (EndGroup, TableEnd, RangeEnd, or GroupEnd) merge field inside the table where the group starts.

Completed
Last Updated: 12 Sep 2023 08:16 by ADMIN
Release R3 2023
Exporting a document with a shape containing PictureFill fails with NullReferenceException.
Completed
Last Updated: 27 Sep 2023 10:27 by ADMIN
Release R3 2023
System.InvalidOperationException is thrown on the import of a document containing content control with no content when it is the first item in the current section. The message is: "Sequence contains no elements".
Completed
Last Updated: 08 Sep 2023 10:10 by ADMIN
Release R3 2023
Handle HTML import of base64 images with no data source.
1 2 3 4 5 6