Questions tagged [tinybutstrong]
TinyButStrong is a template engine for PHP.
147
questions
0
votes
0
answers
13
views
TinyButStrong and CSS
I'm trying to create a website MVC with PHP and TinyButStrong. Everything works just fine except that CSS code does not work with TinyButStrong. Anyone knows the problem here?
file example.html
<...
1
vote
1
answer
45
views
image in OpenTBS not changing
I'm trying to show a series of pictures and comments in a document with OpenTBS. The pictures are hosted on a local webserver. The data is in an array.
In the resulting document the text lines are ...
0
votes
1
answer
34
views
conditional block display with TBS in DOCX tables
I am processing DOCX files for invoices with TBS. A first TBS block contains all the taxable items, one per line, followed by lines for subtotal and tax. A second TBS block contains all the non-...
0
votes
1
answer
21
views
(TBS) TinyButStrong optional sub-blocks
Is there a way to make sub-blocks optional, there are cases when a sub-block doesn't contain any information and I get errors. Lets say I have a block that contains people's data, like their full ...
0
votes
1
answer
19
views
In OpenTBS: How to use "new paragraph" carriage returns instead of "new line" in MS Word Templates
I have a PHP variable holding plain text that i need to insert into a MS Word Template using OpenTBS.
My Word placeholder is:
[onshow.introduction]
The problem is I use justification formatting, so I ...
0
votes
1
answer
47
views
Trying to merge a picture into an OpenTBS template fails with "failed to found the picture" (sic)
Im using OpenTBS to merge data from PHP into a word template.
All the normal variables merge fine, however I fail to succeed at merging an image file.
The placeholder for my image in my Word file ...
0
votes
1
answer
97
views
TinyButStrong update for PHP 8.1?
I've recently updated our server to PHP 8.1 and the latest version of TinyButStrong. The latter now throws a fatal error:
PHP Fatal error: Cannot acquire reference to $GLOBALS in U:\ivojoadmin\...
0
votes
0
answers
22
views
Why does the OpenTBS_DOWNLOAD command is not generating a file
I am new to openTBS,
I tried the html and php code from 'https://www.tinybutstrong.com/opentbs.php?demo' and 'https://www.tinybutstrong.com/plugins/opentbs/demo/demo_merge.php', and I can't manage to ...
0
votes
1
answer
20
views
Merge different .pptx files into one
I am trying to merge different .pptx files into one. That is, I have templates for each slide, I am able to modify MergeBlock and MergeField but I don't know how to join all the .pptx files into one.
...
0
votes
1
answer
18
views
How can I output a comma separated string of values with opneTBS
using openTBS (in the SugarCRM plugin MailMergeReports) and I have the following in my Word template.
[a_sub5;block=w:p;nodata] No States
[a_sub5;block=w:p][a_sub5.name]
This works fine as far as it ...
0
votes
3
answers
64
views
OpenTBS - read docx properties
Is there a way to access docx properties once an OpenTBS template is loaded?
$TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
I know that I could open the docx as a zip, access core.xml in ...
1
vote
1
answer
20
views
Use of ifempty in openTBS docx template
I am trying to use the ifempty attribute in a docx template to choose from 2 available variables. I do not have access to the php files. I am just a user of a system using tbs to allow custom export.
...
0
votes
1
answer
62
views
merge field not Merge data in word document by TinyButStrong
I am using TinyButStrong for merge data in docx file. I have do same example data. For this i have write below code:
<?php
include_once('tbs_class.php');
include_once('../tbs_plugin_opentbs.php'...
0
votes
1
answer
81
views
(TBS) TinyButStrong How to use Multiple 'when' for a block ? Example when [hasHouse] = 1 and [name] = 'bob'
So I have a block and I want to use the 'when' condition, I tried using but got no results.
If I just leave one of the conditions i get back results, but I dont get back anything if I use both, and ...
1
vote
1
answer
35
views
Template engin for e-mails
I use opentbs for document templates (writer and ms word). Now I want to use opentbs also for write e-mails. So that I can read an .msg file prepared from the office and than add senders, customer ...
0
votes
1
answer
27
views
how can we edit chart data in excel worksheet from a ppt generated by tbs?
We have one empty chart and we are loading via tbs and plotting the graph, everything works fine
when we open the newly created ppt and try to edit chart data in excel (Edit data in excel) it's empty, ...
0
votes
1
answer
42
views
TBS tiny but strong: how to recursively fill in data
I use openTBS to parse an invoice template. The invoice address is supplied via a custom function. I would like to conditionally more information to the filled in data.
I was thinking of permitting ...
0
votes
1
answer
41
views
can we delete slides with multiple range using opentbs?
currently we are doing this, which is working fine, but i was trying to delete slide with multiple range
$slides_to_deletea = range(3, $num_slides);
$TBS->PlugIn(OPENTBS_DELETE_SLIDES, $...
0
votes
0
answers
138
views
How can replace content in a document file with another document text, image and table in PHP?
I have to replace the content of a document result.docx with another document server.docx.
I have implemented the PHP code. I used the tinybutstrong plugin to develop functionality.
But there is a ...
0
votes
0
answers
44
views
tinybutstrong - opentbs - colspan in excel
(Sorry my poor english)
I have data:
[
'mainGrp1'=>['subGrp1.1'=>[1,2,3],'subGrp1.2'=>[a,b,c],'subGrp1.3'=>[4,5,6]],
'mainGrp2'=>['subGrp2.1'=>[1,2,3,4,5],'subGrp2.2'=>[a,b,c,d,e]]...
0
votes
1
answer
41
views
subblock create xlsx with opentbs?
Hello I hope you can help me. I am trying to use sub-blocks with the following array that you come from 2 mysql queries.
$data[$i]= array(
"ref"=>$row['ref'],
"label"=>$row['...
0
votes
0
answers
25
views
Can you use the OPENTBS_EDIT_ENTITY to change Word settings?
I use the OPENTBS_EDIT_ENTITY 'word/settings.xml' to change the updateFields setting currently in Word and that has always worked great. Could I also use that for settings like turning view table ...
0
votes
0
answers
24
views
TinyButStrong Block Not Working for li tag
If I define my block on the li tag, TBS only shows the first item in the array.
<ul class="nav navbar-nav">
<li class="dropdown nav-item">
<a href="#...
0
votes
1
answer
28
views
500 Error After Moving Code To New Server
I recently moved my code to a new server with Debian 10 and PHP 7.3.19. The old server had Ubuntu 16.04.15 and PHP 7.0.33. As a result, I am now getting a 500 error on my index.php page. However, if I ...
0
votes
1
answer
114
views
OpenTBS - Repeating Paragraph with Token Replacement?
I have a text-based (as opposed to table-based) .docx document with a section that has several places in the paragraph for replacement. This paragraph must be duplicated and the tokens replaced for ...
0
votes
1
answer
235
views
Use composer's autoload to load OpenTBS plugin for tinybutstrong
I am using tinybutstrong and it's opentbs plugin. Until now I did use an explicit require of the two source files for that but I want to switch to composer with autoloading. So I want to go from this
...
0
votes
1
answer
29
views
massive file size with pictures
I'm using opentbs to get an organization chart with photographs.
People register pictures with no size limit. I'd like to know if it exists a tag that compresses the pictures before editing.
I ...
0
votes
1
answer
84
views
how to select header section in OpenOffice ODT document with TinyButStrong TBS
I can successfully manipulate fields in the header and footer sections of a DOCX document with TinyButStrong (TBS) through this code:
$TBS->PlugIn(OPENTBS_SELECT_HEADER);
$TBS->...
0
votes
1
answer
34
views
how to select master slide in OpenOffice ODG document with TinyButStrong TBS
I can successfully manipulate fileds on a master slide of a PPTX document with this code:
$TBS->PlugIn(OPENTBS_SELECT_SLIDE, '1', true); // select master slide
$TBS->MergeField('...
0
votes
1
answer
56
views
OpenTBS no longer merges fields in ODT - no errors
Long time Tinybutstrong/OpenTBS user here - my application has been moved to a new server (Debian Jessie > Debian Buster), including new versions of Apache (2.4.38) and PHP (7.3 FPM).
$TBS = new \...
0
votes
1
answer
137
views
Can I use TinyButStrong Fields to control paragraph formatting in my Word Table
I have a word table being populated from a MYSQL query and sub query via an OpenTBS template. The main query acts has a single cell merged across the row; the first column of the subquery is merged ...
0
votes
1
answer
46
views
How do i resolve 'Uninitialized string offset:' error in TinyButStrong
I was successfully download the merged spreadsheet document but it gives me these errors instead of the merge values. Why is that and how should i resolve it ?
Notice: Uninitialized string offset: 2 ...
0
votes
1
answer
139
views
Is it possible to change the format in opentbs when using ope=tbs:num?
When merging blocks using opentbs I was able to properly get a field to merge as a number to excel using
ope=tbs:num which I need because I am both displaying the data and performing calculations with ...
0
votes
1
answer
202
views
How to resolve TinyButStrong's 'at least one tag corresponding to w:tr is not found' error?
I'm creating a project to mail merge a given .odt file and provide a .odt output. When i'm performing the mail merge operation it provides me this error
TinyButStrong Error in block's definition [...
0
votes
1
answer
122
views
How to remove or change an image in a docx
I'm trying to change an image embedded in a docx. In some circumstances I'll need to replace a default placeholder image on each page with a new one, and in others I'd like to just remove that ...
0
votes
1
answer
31
views
When my variable has an apostophe in it, it cannot be used for onshow
I'm using a conditional in templating engine tinybutstrong to show a <div> when a variable is not blank.
<div class="notice">[onshow;block=div;when [var.notice;noerr]!=''][var.notice;...
0
votes
0
answers
224
views
TinyButStrong gives an corrupt DOCX file
I'm using TinyButStrong (with opentbs plugin) to merge an DOCX (XLSX/ODT/ODS) file with CSV data (file upload).
On my Linux pc with libre-/openoffice the produced merged DOCX file gives an error:
"...
0
votes
1
answer
79
views
Why is Tinybutstrong Mergeblock giving me the error: 'item before ... is neither an object nor an array. Its type is NULL..'
I am trying to use Tinybutstrong to merge a template with an sql query result. Below is the PHP code being run, the custom database reader plugin I am attempting to use, the template file and the ...
0
votes
1
answer
306
views
How to correctly make conditions in TinyButStrong?
I have to make a template in the TinyButStrong language, but I have no access to the PHP side. I'm just able to modify my template and to upload it on my ERP.
Anyway, the PHP side is working well.
I ...
0
votes
1
answer
35
views
Prepared statements with TBS
I'm trying to merge the results of a prepared statement to TBS. Here's my code:
$s = $link->prepare("SELECT * FROM newsletters WHERE newsletter_id = :newsletter_id");
$s->bindParam(":...
1
vote
1
answer
273
views
OpenTBS/TinyButStrong Is Not Replacing Merge Fields In DOCX
I'm trying to use the OpenTBS/TinyButStrong library to replace merge fields in a word document.
We can take a very basic word document like this:
Hello, My Name Is Bob, My Age Is <<BOBAGE>&...
0
votes
1
answer
43
views
Is there an openTBS command to write/update the Notes section of a pptx slide?
I am using openTBS to update a slide deck and need to also update/replace template content in the Notes section. Is there a command that supports that?
-2
votes
1
answer
812
views
Merge multi doc & docx files in php
I have Multi Files (doc and docx ) maybe one maybe more This is defined by User .
I will get it all and print it in one file So i need to merge it in one file .
$filePath = '../part_folder/' ;
...
0
votes
0
answers
29
views
Generated Excel File doesn't have adjusted row heights upon opening
I've got a template with row height set to Auto. When I merge it with cells that have multi-line data, the row heights are not adjusted when I open the merged document. Oddly, the first few rows are ...
0
votes
2
answers
73
views
The best way to append data to an existing worksheet
I have a workbook which is used to summerize invoicing data. Each month new data from my database needs to be added to to a new column on the end of the worksheet.
Additionally additional information ...
0
votes
2
answers
379
views
Use tbs to merge multiple records from sql to single block with mergeblock
I am using template docx and tbs template engine to generate document by values from sql. I want to load multiple records from sql dynamically to table I created in template docx which have single ...
0
votes
1
answer
109
views
OpenTBS - checking against individual options in a checkbox field to insert conditional content per option
In an OpenTBS situation, I'm trying to use conditional blocks to check against each individual option/answer that a user selects in a checkbox field in a form whose data is being used to insert the ...
0
votes
0
answers
196
views
OpenTBS removes spaces with formatted text in docx
I have a docx file with formatted text. After merging a variable, the spaces disappear before and after formatted text in the result document.
This is the code I use from the example:
include_once('....
0
votes
1
answer
119
views
Is it possible to use a subblock on a subblock when creating docx with opentbs?
I am trying to output an array to docx file with opentbs plugin. My array has a nested array so im using a block for the main array with a subblock for the nested array. This works perfectly. My ...
0
votes
0
answers
102
views
using tinybutstrong i can generate docx but it corrupted
i am using laravel and php and tiny-but-strong-world
engine
i have php file that will generate the docx and i have sample template
docx
but i got the output like this
PK!ߤ?Z [Content_Types].xml ¢(...