Search code examples
phpopentbstinybutstrong

TinyButStrong - OpenTBS


  • Is it possible to add sections to a .docx template dynamically using OpenTBS plugn? Ex: Assume template has numbering from 1-5, and I want to add 5-n sections dynamically.

  • Is it possible to add images dynamically to a table. I tried as follows but didn`t work

    Image located in the same folder and defined the block as below

[a.image;ope=changepic]

$data[] = array('name'=> 'abc', 'address'=>'test' , 'age'=>'25', 'email'=>'test@gmail.com', 'image' => 'pic_1234f.png');


Solution

  • 1)

    The template engine TBS allows you to technically insert a sub-template inside the current document. Wherever, this won't produce the expected result because it implies to retrieve all styles, charts, images, objects from the DOCX to insert ; and to place them correctly inside the target DocX.

    See http://www.tinybutstrong.com/forum.php?thr=3540

    You can modify yourself the inner XML in order to add your sections. But the corresponding XML would probably be also quite complicated.

    It is easier to deleted exiting sections.

    2)

    This is quite complicated for the same reason than above : inserting a new image frame could be quite complicated in a DOCX. Instead OpenTBS gives feature to modify an existing image, or even delete it.