Completed
Last Updated: 11 Sep 2019 06:17 by ADMIN
Release R3 2019

The construct <link rel="stylesheet" href="main.min.css" /> doesn't raise the HtmlImportSettings.LoadFromUri event on import, as we currently require type="text\css" to be specified explicitly.

According to mdn:
The common use of this attribute is to define the type of stylesheet being referenced (such as text/css), but given that CSS is the only stylesheet language used on the web, not only is it possible to omit the type attribute, but is actually now recommended practice. 


Think of improving the message of the exception we throw if no data is loaded.

Workaround: set type explicitly:
<link rel="stylesheet" type="text/csshref="main.min.css" />

Approved
Last Updated: 28 Aug 2019 17:46 by ADMIN
A paragraph containing multiple Hyperlinks inside Fields with missing End FieldCharacter, leads to OutOfMemoryException: 'Exception of type 'System.OutOfMemoryException' when exporting to PDF.

Workaround: Iterate all FieldCharacter instances and move any End FieldCharacter instance to paragraphs with Start FieldCharacters. See the attached project.
 
Approved
Last Updated: 09 Aug 2019 13:35 by ADMIN
Such tags are not supported in RtfFormatProvider and while skipping them, there might be fields that are not properly imported. This can lead to issues while exporting the document. If the document is re-saved using MS Word, the HTML-related tags are removed and the content can be properly imported with WordsProcessing.
Completed
Last Updated: 07 Aug 2019 13:30 by ADMIN
Release LIB 2019.2.812 (08/12/2019)
According to the HMTL specification, the width and height attributes of an img tag has unsigned long values. When a width or height values with a unit suffix is imported, e.g.: 50%, FormatException: 'Input string was not in a correct format.' is thrown.
Completed
Last Updated: 07 Aug 2019 13:23 by ADMIN
Release LIB 2019.2.812 (08/12/2019)
Created by: Blane Bunderson
Comments: 0
Category: WordsProcessing
Type: Bug Report
1
Hyperlinks created via HtmlFormatProvider are not properly exported to PDF and cannot be clicked.
Completed
Last Updated: 07 Aug 2019 10:57 by ADMIN
Release LIB 2019.2.812 (08/12/2019)
When the document contains an image that is defined as an external resource but is not available in the specified location and cannot be found, a KeyNotFoundException is thrown. Handle this exception and replace the missing image with a default one for such cases. Consider exposing an option to notify the user about this error.
Approved
Last Updated: 07 Aug 2019 08:30 by ADMIN
RtfException "Group level reached negative value" is thrown when a document with an image defined as a resource but not found is imported and then exported to RTF
Approved
Last Updated: 07 Aug 2019 06:41 by ADMIN
When an image is placed in a table row and the document is exported to PDF the image top edge is placed at the center of the table border because the border thickness is not respected.
Completed
Last Updated: 06 Aug 2019 13:26 by ADMIN
Release LIB 2019.2.812 (08/12/2019)
When the imported html contains an attribute of the type width="", Wordsprocessing throws ArgumentException and does not import the document. 
Approved
Last Updated: 02 Aug 2019 10:56 by ADMIN
Exporting document with invalid bookmarks throws System.Collections.Generic.KeyNotFoundException.

The issue is caused by an invalid bookmark having missing BookmarkRangeStart/BookmarkRangeEnd elements. As a workaround iterate through document elements and find the missing BookmarkRangeStart/BookmarkRangeEnd and insert the missing range.
Completed
Last Updated: 31 Jul 2019 08:24 by ADMIN
Release LIB 2019.2.805 (08/05/2019)
Importing an image from HTML with URI as a source, which has applied only width or height and exporting it to PDF (which forces getting the image data so it can be drawn) leads to an incorrect value of 1 (a default value) for the dimension that is not specified.
Completed
Last Updated: 31 Jul 2019 07:13 by ADMIN
Release LIB 2019.2.805 (08/05/2019)
When the document contains an image with extension, which is not among the supported ones, a KeyNotFoundException is thrown during Import.
Completed
Last Updated: 08 Jul 2019 10:43 by ADMIN
Release LIB 2019.2.708 (07/08/2019)
An ArgumentException is thrown when importing HTML containing standard and non-standard pseudo classes or pseudo elements. The concreete scenario is the following: 
.myclass::-webkit-scrollbar or .myclass::-ms-expand

The message of the exception is similar to this: "Unexpected character found at position [X]: ".. scrollbar::>>-<<webkit-scrollbar"". 
In Development
Last Updated: 04 Jul 2019 14:19 by ADMIN
If HTML document is imported, and it contains image with invalid URL, then the image is imported with this URL in the document model. On subsequent export to Docx, the library tries to download the image data, which throws WebException. Instead, the image should be replaced with generic 'error' image.

Workaround: Manually test the image URL for correctness on HTML import, and replace the data:

        static void Main(string[] args)
        {
            HtmlFormatProvider htmlFormatProvider = new HtmlFormatProvider();
            htmlFormatProvider.ImportSettings.LoadFromUri += (sender, e) =>
            {
                if (!IsValid(e.Uri))
                {
                    e.SetData(File.ReadAllBytes("no-image.png"));
                }
            };
        }

        private static bool IsValid(string uri)
        {
            try
            {
                using (WebClient client = new WebClient())
                {
                    client.DownloadData(uri);
                }
            }
            catch (WebException)
            {
                return false;
            }

            return true;
        }

The same issue appears when exporting to PDF.
Completed
Last Updated: 01 Jul 2019 07:14 by ADMIN
Release LIB 2019.2.701 (07/01/2019)
When DefaultTabStopWidth of the document is zero, the export to PDF leads to infinite loop which causes the application to freeze.

Workaround
Set the DefaultTabStopWidth with non-zero value:
document.DefaultTabStopWidth = 0.1;
Approved
Last Updated: 18 Jun 2019 14:44 by ADMIN
HTML heading elements (<h1>-<h6>) are imported with the default heading styles (Heading 1 - Heading 6) for RadFlowDocument, which is unexpected, as the browsers and MS Word import them with different styling. 

For example, <h1> is imported as Heading 1 with font the following properties:

Font: Cambria
Font color: Accent 1
Spacing before: 14 pt
Spacing after: 14 pt

While MS Word imports it as:

Font: Times New Roman
Font color: not set (black)
Character spacing: Kern at 18 pt
Spacing before: Auto
Spacing after: Auto
Approved
Last Updated: 18 Jun 2019 14:39 by ADMIN
"bolder" font weight is imported as regular font weight in the RadFlowDocument model. Instead, it should be imported as bold.
Approved
Last Updated: 18 Mar 2019 09:54 by ADMIN
When a list is just before the table, all of its list items are inserted in the first cell of the table while exporting to HTML.

Workaround: Add a paragraph between the list and the table
foreach (var section in this.document.Sections)
{
    bool shouldInsert = false;
  
    foreach (var block in section.Blocks.ToList())
    {
        var paragraph = block as Paragraph;
        if (paragraph != null && paragraph.ListId > -1)
        {
            shouldInsert = true;
        }
        else if (shouldInsert)
        {
            var paragraphToInsert = new Paragraph(this.document);
            paragraphToInsert.Spacing.LineSpacing = 1;
            paragraphToInsert.Spacing.LineSpacingType = HeightType.Exact;
            paragraphToInsert.Spacing.SpacingAfter = 0;
            block.BlockContainer.Blocks.Insert(section.Blocks.IndexOf(block), paragraphToInsert);
            shouldInsert = false;
        }
    }
}
Approved
Last Updated: 13 Mar 2019 21:47 by ADMIN
The current implementation uses System.Windows.Media.Imaging.BitmapImage class in order to take the image pixels for the PDF export. However, BitmapImage class throws NotSupportedException when being initialized with a WMF or EMF image.

WORKAROUND: WMF and EMF images may be converted to PNG images before the PDF export. The following code snippet shows how to convert all inline WMF image to PNG images by using System.Drawing.Image class:

private static void ConvertInlineWmfImagesToPng(RadFlowDocument document)
{
    foreach (ImageInline image in document.EnumerateChildrenOfType<ImageInline>())
    {
        if (image.Image.ImageSource.Extension.Equals("wmf", StringComparison.InvariantCultureIgnoreCase))
        {
            using (MemoryStream wmfImageStream = new MemoryStream(image.Image.ImageSource.Data))
            {
                using (MemoryStream pngImageStream = new MemoryStream())
                {
                    var imageDrawing = System.Drawing.Image.FromStream(wmfImageStream);
                    imageDrawing.Save(pngImageStream, ImageFormat.Png);
                    byte[] pngBytes = pngImageStream.ToArray();
 
                    image.Image.ImageSource = new ImageSource(pngBytes, "png");
                }
            }
        }
    }
}
Approved
Last Updated: 13 Mar 2019 16:39 by ADMIN
Table and table cell borders are not evaluated according to inheritance and conflict resolution rules. A conflict will occur when different borders from the table and table cell are overlapping. 

The GetActualValue method of the TableBorders and TableCellBorders could potentially return an incorrect value in some of the following scenarios:

Scenario 1:
A table has cell spacing set to 0. Meaning that the table and table cell borders will overlap.
The table borders have defined all of its borders with border style "Single".
The table cell borders have all of its borders defined with border style "None".

Expected result: the resulting borders should have the border style set to "None" for the location where the table and the cell borders are overlapping.

Scenario 2:
A table has explicitly defined that its right border is with border style "None".
The table has a table style applied with defined border style of type "Single" for all table borders.

Expected result: All of the table borders except the right border should have border style of "Single".

The problem is mostly visible when exporting to PDF and RTF format.
1 2 3 4 5 6