Forum


Replies: 10   Views: 4069
Footnotes and embedhtml()
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 shroom  · 22-12-2015 - 15:12

Thanks.

In other words, it is currently not possible to insert footnotes into text that contains HTML.  My choices are to either manually parse the text looking for HTML tags, and assemble the docx using addText(), which does support footnotes, or use embedHTML() and forego footnotes. 

I have a suggestion for phpdocx.  Have embedHTML() support a pseudo HTML tag <footnote>:

$thetext = 'The quick <em>brown fox</em><footnote>this is a footnote for the brown fox</footnote> jumped over the lazy <strong>sleeping dog</strong>.<footnote>this is a footnote for the sleeping dog</footnote> And the story continues...';

$docx -> embedHTML($thetext);

EmbedHTML() could then process the <footnote> tag, inserting the proper WordML to have what's contained between the <footnote> tags become Word footnotes.

That's what I'm going to try and do.  Wish me luck.