Could you please tell me is it possible to - load docx document into phpword, then change font name, size, line spacing in that loaded document and then save it to another docx file?
I'm reading phpword official docx right now, but as I see it's much more creating a new document (with some font name, size and line spacing trough setting of a paragraph for example) than for changes in loaded document. Or maybe I'm wrong?
So is it possible to change these "font settings" for loaded document? Or maybe it is possible to some parsing of loaded document, like some foreach for all paragraphs and then change "font settings" for every paragraph of text?
Thank you in advance for your help!
Sincerelly yours,
Alwesu
Yep, changing some of the document default settings is possible. For example changing the default font definitions:
$phpWord = \PhpOffice\PhpWord\IOFactory::load('myfile.docx');
$phpWord->setDefaultFontSize(50);
$phpWord->setDefaultFontName('courier');
for line spacing you can check whether the default value can be modified with the setDefaultParagraphStyles method.