Forum


Replies: 4   Views: 3582
Font size ignored ?
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 Simco Nederland  · 08-01-2018 - 09:41

             $numbering = new \Phpdocx\Elements\WordFragment($docx, 'defaultHeader');
                $numberoptions = array(
                        'textAlign' => 'right',
                'bold' => true,
                'fontSize' => 9,
                'color' => '000000',
                'default' => 1
                );
                $numbering->addPageNumber('page-of', $numberoptions);
                $partialHeaderData2->addWordML($numbering);
                
                $tableData = new \Phpdocx\Elements\WordFragment($docx, 'defaultHeader');
                $values = array(
                        array(
                                array('value'=>$partialHeaderData1, 'width'=>3000), 
                                array('value'=>$partialHeaderData2, 'width'=>2000, 'float' => array('align' => 'right'))
                        )
                );
                
                $options = array(
                'border' => 'none',
                'tableAlign' => 'left',
                'borderWidth' => 0,
                'indent'=>0,
                'cellSpacing'=>0,
                'cellMargin'=>0,
                'columnWidths' => array(3000, 2000),
                'bold' => true,
                'textProperties'=>array('fontSize'=>9)
                );
                
                $tableData->addTable($values, $options);

have this code.
partialHeaderData1 is WordFragment with embedded html.
partialHeaderData2 is WordFragment with embedded html to which we add pagenumbering with addWordML

but no matter which font i set to pagenumbering it still shows it as 10pt in word.. tried even to set font size in code to 29 it still shows that at 10pt.