You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add protected $tempDocumentFootNotes = ''; // to store xml from word/footnotes.xml
add protected function getDocumentContentFootNotes() // return 'word/footnotes.xml';
add $this->tempDocumentFootNotes = $this->zipClass->getFromName($this->getDocumentContentFootNotes()); on public function __construct($documentTemplate) // for read xml and store in $tempDocumentFootNotes
need on $TemplateProcess->setComplexBlock
add private function isFoteNote($complexType) // to know if there are notes in what you want to save
add private function WriteFoteNote($complexType) // add to $tempDocumentFootNotes the note
add private function insertFootNote($xml,$pos) // insert xml footnote into tempDocumentFootNotes
need on $TemplateProcess->saveAs($fileName) specifically in public function save()
use again protected function getDocumentContentFootNotes() // return 'word/footnotes.xml';
add protected function saveFootNote($fileName, $xml) $fileName get from getDocumentContentFootNotes() and $xml get from $this->tempDocumentFootNotes
Is your feature request related to a problem? Please describe.
allow adding a footnote using TemplateProcessor
Describe the solution you'd like
read word/footnotes.xml inside the word file (.docx) and add the footnotes, then inside word/document.xml reference those footnotes
A clear and concise description of what you want to happen.
example
Describe alternatives you've considered
Edit Files: src/PhpWord/TemplateProcessor.php
need on new TemplateProcessor
need on $TemplateProcess->setComplexBlock
need on $TemplateProcess->saveAs($fileName) specifically in public function save()
Edit Files: src/PhpWord/Writer/Word2007/Element/Footnote.php
Additional context
attached
Code.zip
example.docx
TemplateSetComplexValueWithFootNote.docx
The text was updated successfully, but these errors were encountered: