1

如何在我的文档中添加行号?

我添加了这个;

$objWriter->startElement('w:lnNumTyp');
$objWriter->writeAttribute('w:start', '5');
$objWriter->writeAttribute('w:restart', '1');
$objWriter->endElement();

PhpWord\Writer\Word2007\Document.php紧接着我的剧本;

$objWriter->startElement('w:sectPr');

我哪里错了?

4

2 回答 2

3

正确的代码如下;

$objWriter->startElement('w:lnNumType');
$objWriter->writeAttribute('w:countBy', '5');
$objWriter->writeAttribute('w:restart', 'continuous');
$objWriter->endElement();

它仍在继续;

$objWriter->startElement('w:sectPr');
于 2014-03-03T13:17:39.013 回答
1

使用自0.10.0lineNumbering以来可用的 style 属性。Section

例子:section = $phpWord->addSection(array('lineNumbering' => array()));

于 2014-05-21T15:34:32.720 回答