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);
}
}
The control word (\~) is imported but the symbol is not parsed, therefore not included in the content. Fix available in LIB Version 2017.2.814.
In scenarios when center and right tabs are used for aligning the paragraph content to both left and right the text content in the exported PDF is not positioned as expected.
When a paragraph doesn't have applied a style, the Normal style should be automatically applied. Currently, similar paragraph obtains its style from the parent. This is reproducible when exporting to PDF and RTF. Workaround: Check if there is a paragraph without style ID and if so, set it to Normal: foreach (var paragraph in this.document.EnumerateChildrenOfType<Paragraph>()) { var value = paragraph.StyleId; if (string.IsNullOrEmpty(value)) { paragraph.StyleId = "Normal"; } } Available in LIB Version 2017.2.731.
This setting should allow setting the content between the list level bullet and the paragraph text to some of the following options: "tab", "space", "nothing".
Form fields are the legacy way to insert an editable controls in a document (text boxes, checkboxes, dropdowns) by using the FORMTEXT, FORMCHECKBOX and FORMDROPDOWN fields. Do not confuse with content controls (structured document tags) (see https://feedback.telerik.com/Project/184/Feedback/Details/190057 ) and with ActiveX controls.
Add support for the All Caps and Small Caps properties of the runs. These properties are currently ommitted on import.
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; }
This property allows the user to set the transparency of the image watermark. In the XML, the property is written using the 'blacklevel' attribute of the image.
Importing shape with missing id attribute leads to NullReferenceException. <v:shape type="#_x0000_t202" filled="false" stroked="false">
Import of Tables with border style needs improvements. Currently, it takes multiple seconds to import table with 100x6 cells no matter if the border style is defined globally or locally. This may be seen when importing the attached files "table with borders.html" and "table single border style.html". Importing the same table without borders is achieved in less than a second which may be seen with the attached "table without borders.html".
When the <sectPr> element is not defined as the last child element but appears in different position of the <body> of the document, the content after <sectPr> is not imported. Although some applications handle this case, according to the Office Open XML specification, the sectPr element must be the last element inside the <body>.
Add support for character spacing. Currently, such spacing cannot be set and are not imported.
The API should allow the client to navigate to an empty block container and manipulate it. The block containers are Section, TableCell, Header, Footer, Comment. The API should also include manipulation methods for a table like: Add a row to a table. Add a cell to a row. Add a table to an empty cell. Add a paragraph to an empty cell. Add a run to an empty cell. add a text to an empty cell. Move to a next/previous cell. Move to a next/previous row. The API should use the currently applied editor formatting when creating the specified document elements.
Currently the PageOrientation property is used to determine the actual size of the paper to use on the printer and does not reflect document's visualization. In order to affect Section's appearance the user should change the PageSize and PageMargin properties. For convenience the Rotate method is introduced in order to update the properties simultaneously. However the usage of the Section.Rotate(PageOrientation) method is confusing since the properties are not updated when Section.PageOrientation is already set to the same value as the parameter. Also, Rotate method is useful only for rotating already created sections, and to create section with specified pages size and margins the user should set all Section's PageSize, PageMargin, PageOrientation properties anyway. More convenient API must be provided to create Section instances with correctly set properties for the desired page orientation.
Page breaks can be exported and subsequently imported using the "page-break-before: always; " property set of some elements.
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"".
This element specifies that the nearest ancestor structured document tag shall be of a document part type. <w:sdt> <w:sdtPr> … <w:docPartObj> … </w:docPartObj> </w:sdtPr> … </w:sdt> The docPartObj element in this structured document tag's properties specify that the type of structured document tag is a document part. The child elements must specify the gallery and category semantics for this part, if any. Currently, such elements are skipped on import.
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);
The custom document properties enable the users to define their own properties to the document or use one of the predefined. In most of the cases, the document variables can be used instead. More information about them you can find at http://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/concepts/fields/document-variables