PHP利用PhpPresentation生成带点星样式的列表案例写法

具体实现代码如下:

$shape = $slide->createRichTextShape();
$shape->setHeight(80);
$shape->setWidth(950);
$shape->setOffsetX(57);
$shape->setOffsetY(150);
$shape->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT)->setMarginLeft(0)->setIndent(-20);
$shape->getActiveParagraph()->setLineSpacing(100000);  //默认就是100000
$shape->getActiveParagraph()->getBulletStyle()->setBulletType('bullet')->setBulletChar('•');
$textRun = $shape->createTextRun('Date: '.date('M j Y',$res['mtrqf']));
$textRun->getFont()->setName("Garamond");
$textRun->getFont()->setSize(10.5);
$textRun->getFont()->setColor( new Color('FF000000') );

$textRun = $shape->createParagraph()->createTextRun('Total views: '.number_format($res['fans']));
$textRun->getFont()->setName("Garamond");
$textRun->getFont()->setSize(10.5);
$textRun->getFont()->setColor( new Color('FF000000') );

$textRun = $shape->createParagraph()->createTextRun('Total interactions: '.number_format($res['yueduliang']));
$textRun->getFont()->setName("Garamond");
$textRun->getFont()->setSize(10.5);
$textRun->getFont()->setColor( new Color('FF000000') );

效果截图image.png

支付宝扫码打赏 微信扫码打赏

如果本文对你有帮助,欢迎打赏本站

喜欢 ()or分享
    匿名评论
  • 评论
人参与,条评论