Forum


Replies: 3   Views: 2430
How do i addfootnote without replacing the existing footnote
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 elyb  · 10-10-2017 - 06:19

Hi Im trying to addfootnote on my docx.

I can add footnote but the problem is the existing footnote (pagenumber)on my docx is replacing the new one.

I want to retain footnote (pagenumber).

this is my code


$docx = new CreateDocxFromTemplate(FCPATH.$path.$file);
$footnote = new WordFragment($docx, 'document');

$footnote->addFootnote(array(
                         'textDocument' => 'sample text',
                         'textFootnote' => 'test',
                         'footnoteMark' => array('sz' => 16,'font'=> 'Bar-Code 39', 'textAlign' => 
                                                  'right')
                             )
                         );

$docx->addFooter(array('default' => $footnote));
$docx->createDocx(FCPATH.$path.$file);