Approved
Last Updated: 06 Mar 2019 13:39 by ADMIN
ADMIN
Deyan
Created on: 25 Apr 2016 17:41
Category: WordsProcessing
Type: Feature Request
8
WordsProcessing: IncludePicture field (INCLUDEPICTURE)
Add support for INCLUDEPICTURE fields. Such fields should work with nested MERGEFIELD, as this is common scenario.

Workaround: Manually insert images over specific placeholder
RadFlowDocument document = new RadFlowDocument();
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);
  
editor.InsertText("1");
editor.InsertText("EXAMPLE_IMAGE");
editor.InsertText("2");
  
foreach (var run in editor.Document.EnumerateChildrenOfType<Run>().ToArray())
{
    if(run.Text == "EXAMPLE_IMAGE")
    {
        Paragraph paragraph = run.Paragraph;
        int indexOfCurrentRun = paragraph.Inlines.IndexOf(run);
        paragraph.Inlines.RemoveAt(indexOfCurrentRun);
  
        ImageInline imageInline = new ImageInline(document);
        imageInline.Image.ImageSource = newTelerik.Windows.Documents.Media.ImageSource(imageData, "png");
        paragraph.Inlines.Insert(indexOfCurrentRun, imageInline);
    }
}
0 comments