Dear Sir/Madam,
I have a docx document and want to display it in flow layoutmode. It works normally except it cannot show header at the beginning of the document and footer at the end of the document. Please help.
My code is similar as follows (Rte is the RadRichTextEditor control):
DocumentFormatProviderBase provider = new DocxFormatProvider();
Rte.SuspendLayout();
Rte.Document = provider.Import([Docx in byte array]);
Rte.RichTextBoxElement.BackColor = Color.White;
Telerik.WinControls.RichTextEditor.UI.DocumentWebLayoutPresenter presenter = (Telerik.WinControls.RichTextEditor.UI.DocumentWebLayoutPresenter)rte.RichTextBoxElement.ActiveEditorPresenter;
presenter.BackColor = Color.White;
presenter.Margin = new Padding(20);
Rte.ResumeLayout();
Rte.PerformLayout();
This field retrieves a character through a code value specified in the field-argument. Such documents are common and are created when symbols (e.g. with font Windings through Insert -> Symbol dialog) are inserted in RTF documents in MS Word.
Currently invalid attribute values, including invalid or empty values in CSS attributes in the 'style' attribute, could cause importing property with incorrect value, or NullReferenceException (the document cannot be imported). Examples: ---------------------------------------------------------- <table width=”*”> <tr> <td>More Random Text</td> </tr> </table> The table is imported with 0 width. Instead the width should not be set. ---------------------------------------------------------- <table style="font-size:;"> <tr> <td>More Random Text</td> </tr> </table> NullReferenceException is thrown. ---------------------------------------------------------- <p style='padding: 3px 3px 3xp 7px;'>test</p>
IndexOutOfRangeException is thrown.
----------------------------------------------------------Workaround: replace the invalid values before import: string importString = html.Replace("font-style: ;", "");
The field result shows the number of pages the current section contains.
See attached!
<samp> HTML element could be imported as span with specific formatting. Currently it's just ommited.
Provide functionality allowing a document to be thumbnailed. The customers should be able to export a document to an image. Workaround: Use attached project.
Currently unknown/unsupported elements are skipped, which potentially loses text content. Consider adding setting in HtmlImportOptions allowing the phrasing content (text) of these elements to be imported. Sample HTML: <html> <body> <test-test>test-test</test-test> <body/> </html> Browsers visualize it as "test-test", while RadRichTextBox doesn't import anything. MS Word imports such elements as inline elements (just like spans).
When the content of an entire row is copied and the caret is inserted in the left most column of a row, then the content of each cell in that row should be overwritten with the contents in the clipboard when pasted. When such content is pasted just after a table, new row is added and filled with values. When such content is pasted in paragraph, new table is created.
Workaround: Handle the CommandExecuted event and change the font family after executing the paste command: private void RadRichTextEditor1_CommandExecuted(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutedEventArgs e) { if (e.Command is PasteCommand) { foreach (var p in this.radRichTextEditor1.Document.EnumerateChildrenOfType<Paragraph>()) { if (p.IsInList) { var list = this.radRichTextEditor1.Document.ListManager.GetDocumentListById(p.ListId); list.ActualStyle.Levels[0].FontFamily = new Telerik.WinControls.RichTextEditor.UI.FontFamily("Symbol"); } } } }
Please refer to the attached screenshots. A sample .docx file is attached. Just load it in RadRichTextEditor.
Implement commands and UI for producing labels using Mail Merge. Behind the scenes this is implemented as Table with the proper number of table columns and rows, and eventually (depending on the setup) NEXT field (https://support.office.com/en-us/article/Field-codes-Next-field-3862fad6-0297-411a-a4e7-6ff5bcf178fd?ui=en-US&rs=en-US&ad=US) - so this will eventually require implementing NEXT field. Note: In MS Word, this is in Mailings -> Start Mail Merge -> Labels...
Add support for All Capitals (All caps) and Small Capitals (Small caps) run property. MS Word has such option in Home -> Font -> Dialog Launcher -> Font -> All Caps/Small Caps. All letters of such runs are visualized as capital letters. The corresponding elements in OOXML are <w:caps /> and <w:smallcaps />.