页码用PhpWord罗马数字
我正在使用这个phpword库: 我对页码中的罗马数字有一个问题,phpword是否可以用罗马数字代替标准数字来显示页码 我在库中找到了这行代码:页码用PhpWord罗马数字,php,phpword,Php,Phpword,我正在使用这个phpword库: 我对页码中的罗马数字有一个问题,phpword是否可以用罗马数字代替标准数字来显示页码 我在库中找到了这行代码: protected $fieldsArray = array( 'PAGE' => array( 'properties' => array( 'format' => array('Arabic', 'ArabicDash', 'alphabetic', 'ALPH
protected $fieldsArray = array(
'PAGE' => array(
'properties' => array(
'format' => array('Arabic', 'ArabicDash', 'alphabetic', 'ALPHABETIC', 'roman', 'ROMAN'),
),
'options' => array('PreserveFormat'),
),
...
);
只是想知道我怎样才能得到它。您可以通过以下方式实现这一点
$phpWord = new PhpWord();
$section = $phpWord->addSection();
$footer = $section->addFooter();
$textRun = $footer->addTextRun(array('alignment' => Jc::CENTER));
$textRun->addField('PAGE', array('format' => 'ROMAN'));
$textRun->addText(' of ');
$textRun->addField('NUMPAGES', array('format' => 'ROMAN'));
您可以通过以下方式实现这一点
$phpWord = new PhpWord();
$section = $phpWord->addSection();
$footer = $section->addFooter();
$textRun = $footer->addTextRun(array('alignment' => Jc::CENTER));
$textRun->addField('PAGE', array('format' => 'ROMAN'));
$textRun->addText(' of ');
$textRun->addField('NUMPAGES', array('format' => 'ROMAN'));
从代码库中的快速搜索中,我的猜测是,您只需设置脚注属性,如第53ff行中的示例所示据我所知,这只适用于脚注,而不适用于页码。我的猜测是,通过在代码库中快速搜索,您只需设置脚注属性,如第53ff行的本例所示。-据我所知,它只适用于脚注,而不适用于页码。它适用于脚注,不适用于页码。它适用于脚注,不适用于页码。