Exception trying to import HTML that contains width with an empty value. For example:
<table width="">
When replacing a string within a run that is not the first element in the paragraph an unexpected behavior occurs.
These are the known cases:
The exception is thrown during the exporting of the document with the following stack trace:
Telerik.Windows.Documents.Flow.FormatProviders.Docx.Model.Elements.Styles.ShadingElement.FillAttributes(IPropertiesWithShading properties)The content controls ID's must be set automatically when once clones or inserts an SDT.
Workaround: Manually set the ID
SdtRangeStart start = grpContentControls.Where(c => Convert.ToString(c.SdtProperties.Tag) == "purchlastname").First();
var properties = new SdtProperties(start.SdtProperties);
properties.ID = 123456;
var currentItem = editor.InsertStructuredDocumentTag(properties);
<w:tblCellMar>
<w:top w:w="2880" w:type="dxa"/>
<w:bottom w:w="2880" w:type="dxa"/>
</w:tblCellMar>
<w:tblCellMar>
<w:top w:w="2880" w:type="dxa"/>
<w:left w:w="0" w:type="dxa"/>
<w:right w:w="0" w:type="dxa"/>
<w:bottom w:w="2880" w:type="dxa"/>
</w:tblCellMar>
Importing html image with no source and then exporting it to pdf causes an exception, instead of omitting the faulty image.
Such images can be stripped using the following workaround:
List<ImageInline> images = this.document.EnumerateChildrenOfType<ImageInline>().ToList();
foreach (var image in images) { if (image.Image.ImageSource == null) { image.Paragraph.Inlines.Remove(image); } }