问题标签 [opentbs]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
938 浏览

php - 如果没有合并任何内容,您可以使用 OpenTBS 删除 PHP 中的文本行吗

我一直在使用 OpenTBS 来修改 DOCX 文件。当我将我的数据库信息与 DOCX 文件合并时,它总是为我的数据库中丢失的任何信息留下空白数据。

这是左侧我的“源”文档的图像,右侧是我的合并图像。在 OpenTBS 中合并文档问题

我该如何去除多余的换行符?

如果对您有帮助,这是生成此合并的代码

0 投票
1 回答
710 浏览

php - 如何用openTBS合并一页上的多个标签?

我想知道在一个页面上处理多个合并的最佳方法是什么。像这样一个官方的 avery 地址标签模板:

艾利地址模板

我的目标是为地址标签创建一个 docx 模板,然后使用 openTBS 对其进行处理,以便每个数据库地址行都以一个新的标签字段结束,但不一定是一个新页面。

我在理解如何实现这一点时遇到了很多问题。

这可以通过类似于分页符的方式在模板内完成,因此无需额外的 php 关注吗?

或者它是否需要更多的 php 关注,我的意思是为一个页面上的每个标签设计一个单独的块,然后是一个分页符。然后在 php 方面,我需要知道模板中有多少块,并为每个块分配一个合并块。

如果只有后一种方法有效,是否有一种简单的方法来解析模板并找出其中存在多少块?

0 投票
3 回答
1650 浏览

php - How to insert conditional spaces in docx with opentbs (only if certain fields are not blank)

I am using opentbs to generate reports in .docx format from data entered by users into a form, and would like to be able to add spaces between fields conditionally. Here's the paradigm example of the issue: The user must enter a street address (address1), but the fields immediately before and after the address field (business and address2, respectively) are optional. Is there a way to set up the merge fields in the template so that, if the user puts something into the business field, the document resulting from the merge will have the value of the business field followed by a space, but if the user leaves the field blank, the document resulting from the merge will not have either the field or the space? I can see two possible ways of achieving this: 1. using a stand-alone merge field that prints a space only if the field "business" is not blank; or 2. using a merge field in the template that prints both the value of the field and a space, but only if the field is not blank.

Here's my psuedocode for these two solutions: 1. [onshow.business][onshow;if[business]!=blank;then' ';else''][onshow.address1] 2. [onshow.business AND ' '][onshow.address1]

It seems like this must be possible, and yet I haven't been able to find a way to turn either pseudocode into real, functioning merge fields in my docx. template. I've searched all of the entries on this forum and on the tbs forum, as well as the documentation, but the issue hasn't squarely been raised, and the things I have tried have not worked. Any help would be much appreciated.

0 投票
1 回答
315 浏览

symfony - 如何获取 TinyButStrong 生成的文件处理程序

我会链接到发送 TinyButStrong 使用 Swiftmailer 生成的 .odt 文件。这是 mu 当前代码

我已附上文件,但无法使用 LibreOffice 打开文件。

那么有没有办法让正确的文件处理程序能够稍后将其附加到我的电子邮件中?任何帮助表示赞赏。谢谢

0 投票
0 回答
346 浏览

php - How to make more than one page with OpenTbs?

I want to make a report receipt, if more than one then the data will be displayed on the next page, the following code that I have made :

Thanks

Edited :

So, the above code I fixed it to be like this, but another obstacle emerged, namely the use of the function IF ELSE in DOCX is like what ?

I have two data [vehicle & estate], when the vehicle data in a data view vehicle only, so also on the contrary

0 投票
1 回答
469 浏览

php - docx中的opentbs条件语句

如何显示和隐藏标签 [Merk - Track - Type || 位置 - 证书],所以这里是:当我有车辆数据时,数据会出现:

和土地数据数据不出现,否则。

我的完整代码:

之前谢谢。

0 投票
1 回答
2184 浏览

docx - 使用基于变量值的 OpenTBS 在 .docx 中条件显示文本块

在我的项目中,我使用 TinyButStrong / OpenTBS 从模板生成 Word 文档。首先,我myuser在文档中加载一个变量。

该文档提供了所需的变量,因此我可以在将名称放置在变量上的位置添加如下标签:

条件值也可以正常工作:

但是当我有多个要显示/隐藏的段落时,选择正确的段落(或更改模板并添加段落)并不容易。是否可以创建具有基于值显示的“开始”和“结束”的块?像这样的东西(伪代码):

我在 TBS/OpenTBS 文档中找不到任何这些。有人知道这样做的方法吗?

谢谢!

尼尔斯

0 投票
2 回答
875 浏览

symfony - OpenTBSBundle - 找不到模板

我不知道如何加载模板。我收到此错误: TinyButStrong Error OpenTBS Plugin: The template '/home/chuebert/Web/garmanzky/repu/src/Bundle/UserBundle/Controller/../../../../web/tbs-templates/找不到 klinik_template.pptx'。该过程正在结束,除非您将 NoErr 属性设置为 true。

我在http://www.tinybutstrong.com/的文档中找不到帮助。我不明白如何加载我的 pptx 文件。

请帮忙。

0 投票
1 回答
294 浏览

templates - OpenTBS odp - 自动幻灯片添加和子块

我有一个这样的数组:

没有“匹配”和没有子属性,它可以正常工作。这是我的模板: 在此处输入图像描述

我想用模块对表进行分类:

模1表1

模2表2

在幻灯片结束后我想要一张新幻灯片。

非常感谢大家如何帮助我;)

0 投票
1 回答
159 浏览

templates - opentbs doesn't print last row on xlsx

I'm trying to print a XLSX file with OpenTBS. The issue us that I can't get the last row printed. Instead, OpenTBS just let the code ([base_sub2_sub1.respostas_dadas]) stay there, on the merged file.

A screenshot from the template: enter image description here

I already checked the data from mysql and it's all there.

Any help?