A
A
Arthur2021-02-04 09:46:58
PHP
Arthur, 2021-02-04 09:46:58

PhpOffice.TemplateProcessor. How to make part of a string bold when substituting a value using setValue?

We want $zn["fiz_adr"]["value"] to be bold.
Split into variables - not suitable. This is a form and depending on the choice of jur. faces different signatures must be
w:br/ - line break

$zn_word["doc_number"]["value"] = $zn["form_zack_name"]["value"].'<w:br/>'.$zn["fiz_adr"]["value"];
   $templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor('forms/word_temp/kopdoc_obuch_izm_stoim_dop_2.docx');
   $templateProcessor->setValue('doc_number', $zn_word["doc_number"]["value"]);
   $templateProcessor->saveAs('forms/upload/'.$time_dop_word);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arthur, 2021-02-05
@warexs

https://github.com/PHPOffice/PHPWord/issues/1154
Here is the solution, but when I took the actual library from the git, the method worked in it via FORMAT=B
Take the library from the example - https://github.com/PHPOffice/ PHPWord/issues/750#is...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question