Hi there,
How do I make phpdocx to use the actual 'Footnote text' style in Word for the text used in footnotes? It just uses the 'Normal' style for footnote texts.
Hi there,
How do I make phpdocx to use the actual 'Footnote text' style in Word for the text used in footnotes? It just uses the 'Normal' style for footnote texts.
Hello,
By default, phpdocx adds footnoteTextPHPDOCX as paragraph style to footnote contents. If you want to override it, you need to set a custom paragraph style creating a WordFragment:
$wordFragmentFootnote = new WordFragment($docx, 'footnote');
$wordFragmentFootnote->addText('Footnote content', array('pStyle' => 'custom_paragraph_style'));
$footnote->addFootnote(
array(
'textDocument' => 'footnote',
'textFootnote' => $wordFragmentFootnote,
'footnoteMark' => array('customMark' => '*')
)
);
There's no option to get if there's a footnote style in a DOCX template and apply it to new footnotes automatically (many DOCX don't have a speficic style for footnotes). It must be applied using the pStyle option, although it could be queried using methods such as getWordStyles.
Regards.