DocumentAssembler and RTF

Home Forums Open-Xml-PowerTools DocumentAssembler and RTF

Tagged: , , ,

This topic contains 2 replies, has 2 voices, and was last updated by  Christian 7 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3489

    Christian
    Participant

    Hi,

    I’ve made a Template with RichText Content Control and try to bind it with RTF text in the XML file.

    It works but the RTF is place as pure text and not interpreted as RTF text.
    What can I do to insert/bind RTF text to the Word document.

    Here is my XML file

    <?xml version="1.0" encoding="iso-8859-1"?> 
    <Root>
    	<DateSeance>Vendredi 26 juin 2016</DateSeance>
    	<DateConvocation>Lundi 21 juin 2016</DateConvocation>
    	<RTFXML>{\rtf1\ansi\ansicpg1252\deff0\deflang2060{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
    {\colortbl ;\red255\green0\blue0;}
    {\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang12\f0\fs22 Ici \cf1\i est \cf0\i0 un \b texte \ul\b0 en \ulnone RTF\par
    \par
    }</RTFXML>
    </Root>

    I try it with the First Sample “DocumentAssembler.exe”
    Do I need special code or tags in Word template to make RTF text working ?

    #3510

    Eric White
    Keymaster

    Hi Christian,

    Binding to RTF text is not a feature of DocumentAssembler. It is a great idea, though, but DocumentAssembler was not designed for this scenario.

    In general, the idea behind DocumentAssembler is that the actual formatting of the document should reside in the template document, and the XML file should contain only data.

    Cheers, Eric

    #3513

    Christian
    Participant

    Thanks,

    So, instead, can I use the documentbuilder (and the AltChunk?) to achieve the same target ?? The problem with the documentbuilder, is I don’t know how to repeat the sections in a loop.

    Here is a Template I’d like to use with RTF. All is working fine with DocumentAssembler except the RTF section.

    Word template

    Thanks

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.