private static void SplitDocument(RadFlowDocument sourceDocument, RadFlowDocument targetDocument){ DocumentElementImporter importer = new DocumentElementImporter(targetDocument, sourceDocument, ConflictingStylesResolutionMode.UseTargetStyle); Section section = sourceDocument.EnumerateChildrenOfType<Section>().First(); Section importedSection = importer.Import(section); targetDocument.Sections.Add(importedSection); sourceDocument.Sections.Remove(section);}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.
When the imported html contains an attribute of the type width="", Wordsprocessing throws ArgumentException and does not import the document.
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 with extension, which is not among the supported ones, a KeyNotFoundException is thrown during Import.
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"".
document.DefaultTabStopWidth = 0.1;Implement support for pictures with references represented with the r:link attribute in the schema.
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.
These file formats are very similar to DOCX, and can be easily imported with loss of some information (e.g. macros).
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; } }}