This is caused by hasSize field in ShapeBase class which is set when decoding the image size. However, when SetWidth and SetHeight methods are called before the size is initialized the value of hasSize is false which causes the issue. Workaround: Call the Size property getter before calling SetWidth/SetHeight method. See the code below: // This line workarounds the issue with SetWidth method which does not get the correct size when locking aspect ratio. Size size = imageInline.Image.Size; imageInline.Image.SetWidth(true, width);
Importing shape with missing id attribute leads to NullReferenceException. <v:shape type="#_x0000_t202" filled="false" stroked="false">
The properties applied to the paragraph marker are not respected when evaluating the style of the child elements. That leads to exporting the bullets in a list with their default settings when they are applied to the paragraph properties. The issue is reproducible when exporting to PDF and RTF. Workaround, applicable when the style of all the bullets in the specific list is the same: Change the style of the list level:foreach
(var paragraph
in
this
.document.EnumerateChildrenOfType<Paragraph>())
{
if
(paragraph.ListId > -1)
{
this
.document.Lists.GetList(paragraph.ListId).Levels[paragraph.ListLevel].CharacterProperties.CopyPropertiesFrom(paragraph.Properties.ParagraphMarkerProperties);
}
}
Importing a document containing a bookmark located in a structured document tag (sdt) will lead to ArgumentNullException.
When exporting to PDF a paragraph in a list, whose first run is longer than the line, the bullets are rendered with wrong baseline and not aligned with the text.
The default table style is not respected from the style system for character or paragraph properties when exporting to PDF format. It looks only into the default paragraph style. Steps to reproduce: 1. Create new Table style and set it as default. 2. Apply foreground themeable color with a value from the document theme. Like Accent1 3. Insert a table with some text in it. 4. Export to PDF. Observed: The text inside the table is not with the color from the document theme.
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.
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.
This is happening because the cell with preferred width 100% takes all the available width and all other columns are rendered with no available width which causes the height of the table to grow big. WORKAROUND: Either clear the cell PreferredWidth property or set it to value which is smaller than 100%.
When the imported html contains an attribute of the type width="", Wordsprocessing throws ArgumentException and does not import the document.
Although this is not a valid table scenario we should not throw an exception when measuring and exporting such table. Fix available in LIB Version 2017.3.1218.
HtmlFormatProvider treats <script type="text/javascript"> as document elements and inserts the content (js code) as text in the document. The issue is observed when CDATA is used as well.
A NullReferenceException is thrown when importing a hyperlink that doesn't contain any run elements. Similar hyperlinks could be skipped so the document can be successfully imported. Available in R3 2018 SP1 release.
When a document with ordered list is exported to RTF and opened with WordPad or WinForms' system RichTextBox the numbers of the list are replaced by "{0}".
The theme xml element (root of the theme.xml part) has a name property which is optional. However, WordsProcessing throws an exception when it doesn't find a name.
The exception is thrown because the AltChunk element is added for import, but we currently do not have implementation for importing of AltChunk elements: https://feedback.telerik.com/Project/184/Feedback/Details/190095-wordsprocessing-add-support-for-altchunk-element
Add support for importing the text values of the input element. They could be imported as a simple text to preserve the content.
When a break element is defined in the middle of a Run, DocxFormatProvider imports it at the end of the same run. For example, the following content: <w:r> <w:t>This is</w:t> <w:br/> <w:t xml:space="preserve"> a simple sentence.</w:t> </w:r> Results in "This is a simple sentence " + break element after it.
Currently there is no easy way to modify the properties of bookmarks and fields in the document. Think of providing API for easier manipulation. For example, following is one of the easiest approached to change the target of hyperlinks: var hyperlinkStarts = document .EnumerateChildrenOfType<FieldCharacter>() .Where(fc => fc.FieldCharacterType == FieldCharacterType.Start && fc.FieldInfo.Field is Hyperlink); foreach (var fieldCharacter in hyperlinkStarts) { int indexOfCodeRun = fieldCharacter.Paragraph.Inlines.IndexOf(fieldCharacter) + 1; Run hyperlinkCode = (Run)fieldCharacter.Paragraph.Inlines[indexOfCodeRun]; string oldUri = ((Hyperlink)fieldCharacter.FieldInfo.Field).Uri; string newUri = "mailto:mail@mail.com"; hyperlinkCode.Text = hyperlinkCode.Text.Replace($"\"{oldUri}\"", $"\"{newUri}\""); fieldCharacter.FieldInfo.UpdateField(); }
Run's default constructor creates it with Text = null. When document with such run is exported to PDF, NullReferenceException is thrown. Workaround: Create the Run and immediately set its Text property to string.Emtpy. Available in LIB Version 2018.1.423.