opentbs

TinyButStrong OpenTBS include output of one template into other Sub Templating

牧云@^-^@ 提交于 2021-02-18 19:32:13
问题 we are using TinyButStrong and OpenTbs to prepare word (docx) documents from templates. We basically need to process several sub-templates (based on what user selected) and then merge all as table rows into the main template. So basically we need something like this: Final Template Table Row 1 - Output from docx1 template Row 2 - Output from docx2 template The rows can vary, so do the sub template file for each individual row. TBS seems to have a subtpl markup, however its not clear how it

Prevent Word 2010 from saving o:gfxdata base64 or uuencoded VML?

一个人想着一个人 提交于 2020-01-23 01:37:48
问题 I am working with .docx files containing several drawing canvases with images inserted and some lines and arrows drawn in Word 2010. I am using 2010 format with no compatibility mode. Word inserts an o:gfxdata attribute into each v:shape and v:group element and fills it with ascii encoded something. From what I have read it may be a copy of the VML describing the v:shape or v:group . I don't know if I just don't know what to look for, but I cannot determine what this data is for as its

OpenTBS - How to use a double loop

爷,独闯天下 提交于 2020-01-06 23:50:32
问题 I am trying to create a block inside a sub block in a .docx using openTBS , with no success so far. Here is my PHP array : $myBlock = array( 0 => array( 'description' => 'description1', 'name' => 'name1', 'photos' => array ( 0 => array( 'path' => 'C:\path_to\pic_0000y.png', 'name' => 'photo0000'), 1 => array( 'path' => 'C:\path_to\pic_1111y.png', 'name' => 'photo111'), ), // end of photo array ), // end of first element 1 => array( 'description' => 'description2', 'name' => 'name2', 'photos'

Can a 'when' conditional section show content based on a 'contains' or 'includes' parameter?

扶醉桌前 提交于 2019-12-26 12:38:25
问题 I'm using TBS/OpenTBS (thanks Skrol, it's awesome) to produce Word documents based on form inputs. One of the form fields is a checkbox. Let's say it has ten options. I can display content fine if a single option is selected, but if, say, 4 options are selected, I need to define a condition in my template for what happens if those precise 4 options are selected. I would have to do the same for every other permutation. What I'm trying to do is use a 'when'-based conditional section so that it

Inserting a bullet point and styling to [onshow.] entires in openTBS

筅森魡賤 提交于 2019-12-13 21:23:36
问题 I was wondering if there was a way to pass through a bullet point and a basic CSS colour styling for the bullet point via the variable that gets applied via onshow. IE $string = '<span style="color:red">&#149;</span> The rest of the string'; $TBS -> VarRef['bulletPoint'] = $string; And then in the docx template have [onshow.bulletPoint] which gets replaced with • The rest of the string But with the bullet point red in this case. 回答1: For the bullet, you can use the UTF8 common character.

OpenTBS: How to dynamically change color of rows in a table

北慕城南 提交于 2019-12-11 21:26:10
问题 I use a table in docx file with the following rows: [b.num;block=w:tr] [b.name] In PHP, I use $TBS->MergeBlock('b', $data_1); which adds the content from the $data_1 array. The question is, how can I dynamically control the text color in each row, e.g. if the name is "John", then mark it in red, otherwise use blue? 回答1: I can suggest two solutions. 1) use conditional sections For this, use one row for each possibility: [b.num;block=w:tr;when '[b.name]'='John'] (red) [b.name] [b.num;block=w:tr

OpenTBS/PHP - Merge content into embedded worksheet inside of a PowerPoint template

ぃ、小莉子 提交于 2019-12-10 11:49:49
问题 How do I properly fill an embedded worksheet of a PowerPoint template with data using OpenTBS, where the worksheet is embedded inside of a PowerPoint presentation? I used sub files but the embedded worksheet retains the input tags and no replaced values. Excel Template that merges properly as a standalone xls file, but not when embedded in a presentation (PPTX). +------------------------------+---------------------------------+ | | [c.key;block=tbs:cell] | +------------------------------+----

openTBS remove image when replace not found

微笑、不失礼 提交于 2019-12-10 11:38:12
问题 How do you remove the image in OpenTBS if the one you are replacing it with does not exist? I have a bit of code that loops through and replaces pics in a table, but sometimes the client will not have the pictures. I tried leaving out the default=current tag but it shows a missing image box("This image cannot currently be displayed"). UPDATE: I thought Skrols answer would work but I couldnt get it to work. I have an image followed by the following tag. [field.p5;ope=changepic;from=’[val]’

Prevent Word 2010 from saving o:gfxdata base64 or uuencoded VML?

时光毁灭记忆、已成空白 提交于 2019-12-04 13:36:15
I am working with .docx files containing several drawing canvases with images inserted and some lines and arrows drawn in Word 2010. I am using 2010 format with no compatibility mode. Word inserts an o:gfxdata attribute into each v:shape and v:group element and fills it with ascii encoded something. From what I have read it may be a copy of the VML describing the v:shape or v:group . I don't know if I just don't know what to look for, but I cannot determine what this data is for as its removal has no apparent effect on my ability to read or edit the document in Word 2003, 2007, or 2010. It

OpenTbs convert html tags to MS Word tags

瘦欲@ 提交于 2019-11-30 21:51:01
问题 I am using OpenTbs, http://www.tinybutstrong.com/plugins/opentbs/tbs_plugin_opentbs.html. I have a template.docx and am able to replace fields with content but if the content has html code it is displayed in the document created by the template. First list <br /> Second Line I have tried to use: $TBS->LoadTemplate('document.docx', OPENTBS_ALREADY_XML); Thinking this would allow me to replace my html tags with ms office tags, but it just showed the MS Office tags in the document instead: First