Categories > OpenTBS with DOCX >

WordML raw code insertion

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Ive
Date: 2013-04-19
Time: 09:23

WordML raw code insertion

I am using openTBS to generate a docx file and that all works great! Now I am trying to do some simple html tag to word tag conversion with 'onformat=f_html2docx' added to my field inside my Word template. Everything gets replaced, but my document now has the replaced tags just as text. I tried opening my template with the 'OPENTBS_ALREADY_XML' parameter (was suggested somewhere), but then my Word file just gets corrupted.

Is there an example somewhere of how to insert raw WordML code into a docx template or something?
By: Sarah
Date: 2013-04-19
Time: 17:26

Re: WordML raw code insertion

Have you tried parameter strconv=no? http://www.tinybutstrong.com/manual.php#html_field
By: Ive
Date: 2013-04-29
Time: 12:59

Re: WordML raw code insertion

Hi Sarah,

Thanks for your answer!

I also came across the strconv=no option, no idea if that works because every time I just open '$TBS->LoadTemplate($template, OPENTBS_ALREADY_XML);' and save '$TBS->Show(OPENTBS_DOWNLOAD, $output_file_name);' my template, my file gets corrupted. If I just remove the OPENTBS_ALREADY_XML option when opening the template, it works fine, but no tag conversion has been done. I just get the xml stuff.

Any Ideas?
By: Sarah Kemp
Date: 2013-04-29
Time: 19:09

Re: WordML raw code insertion

Have you tried OPENTBS_DEBUG_XML_SHOW instead of OPENTBS_DOWNLOAD so you can see what is going on? I suspect if your document is displaying WordML (is it displaying WordML or XML?) as text that the tags are not really tags any longer, they have probably been converted to entities. You will be able to see if that is true by using OPENTBS_DEBUG_XML_SHOW in your $TBS->Show() call. It will help to know if that is the case and if strconv=no is having no effect.
By: Ive
Date: 2013-05-03
Time: 08:00

Re: WordML raw code insertion

Thanks! I'll try that and see what's wrong.