Forum


Replies: 5   Views: 745
Checkbox funcional
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 27-09-2022 - 11:46

Hola,

Los elementos tipo block se deben añadir invocando su método directamente, no mediante addText. El método addText los añade como contenido inline.

Es decir, directamente al documento:

$docx->addStructuredDocumentTag('checkbox', ['fontSize' => 9, 'checked' => true]);

O como elemento WordFragment utilizando addWordFragment u otros métodos compatibles con WordFragments de tipo block:

$wordFragment = new WordFragment($docx);
$wordFragment->addStructuredDocumentTag('checkbox', ['fontSize' => 9, 'checked' => true]);
$docx->addWordFragment($wordFragment);

Saludos.