Hi,
I try to do the following:
1. Load .docx document into the RichTextBox
2. Let the user edit the document
3. Perform MailMerge on the document
4. Export the result as PDF witha compliance level PdfComplianceLevel.PdfA1B
Only the WordsProcessing library supports the compliance level, so I need to convert the RadDocument to a RadFlowDocument.
When I export the RadDocument from the RichTexBox back to .docx I somehow loose all the styles (See WordBefore.png, WordAfter.png).
When I export the RadDocument to .rtf, it keeps the correct styles, but when I import it using the Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider, I get the following Exception:
Message: The document element is already associated with a parent.
Parametername: item
StackTrace: bei Telerik.Windows.Documents.Flow.Model.Collections.DocumentElementCollection`2.VerifyDocumentElementOnInsert(T item)
bei Telerik.Windows.Documents.Core.Data.DocumentElementCollectionBase`2.Add(T item)
bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.RtfImportContext.AddInline(InlineBase inline)
bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.TagHandlers.GroupTagHandlers.BookmarkEndHandler(RtfGroup group, RtfImportContext context)
bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.RtfDocumentImporter.DoVisitGroup(RtfGroup group)
bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.RtfElementIteratorBase.VisitElement(RtfElement element, Boolean recursive)
bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.RtfElementIteratorBase.VisitGroupChildren(RtfGroup group, Boolean recursive)
bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.RtfDocumentImporter.ImportRoot(RtfGroup rtfGroup)
bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.RtfDocumentImporter.Import(Stream input)
bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider.ImportOverride(Stream input)
bei Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Import(Stream input)
...
Do you have any proposal for me how I can accomplish this?