如果单词过多,则deleteBlock停止工作

时间:2019-01-28 11:07:14

标签: php phpword

我尝试在模板中使用deleteBlock,但是如果模板中的字符/单词过多,则deleteBlock停止工作。

例如,我使用带有以下文本的简单模板(完全没有格式,新的docx文件):

PHP Word
PHPWord is a pure PHP library for reading and writing Word, ODT, and RTF files. This file is the source file of read/write capabilites of PHP Word. The text in red should be changed when writing.
${delete}
PHPWord can apply font formats such as bold, italics, color, underline, strikethrough, subscript, superscript, or highlighted. You may also notice that there’s one text break (empty paragraph) before this one that can be created also by PHPWord.
${/delete}
PHPWord can also format paragraph such as this justified, 12pt before and 12pt after with 1.5 lines spacing paragraph. This formatting can be applied inline or using predefined style as we use to do in Word.

可以,但是如果我添加一个段落,则不起作用:

PHP Word
PHPWord is a pure PHP library for reading and writing Word, ODT, and RTF files. This file is the source file of read/write capabilites of PHP Word. The text in red should be changed when writing.
${delete}
PHPWord can apply font formats such as bold, italics, color, underline, strikethrough, subscript, superscript, or highlighted. You may also notice that there’s one text break (empty paragraph) before this one that can be created also by PHPWord.
${/delete}
PHPWord can also format paragraph such as this justified, 12pt before and 12pt after with 1.5 lines spacing paragraph. This formatting can be applied inline or using predefined style as we use to do in Word.
PHPWord can also format paragraph such as this justified, 12pt before and 12pt after with 1.5 lines spacing paragraph. This formatting can be applied inline or using predefined style as we use to do in Word.

这里是有人想要尝试的文件:

https://wetransfer.com/downloads/b6731f6817ce7a8f0991546b02d4596120190128110140/5babac

您知道deleteBlock是否有限制?

您是否知道phpword和deleteBlock是否还有其他替代方法可以从模板生成长文本?

感谢您的帮助,这让我发疯了!

0 个答案:

没有答案