PHPWord - set line spacing to “single”

纵饮孤独 提交于 2021-02-08 05:28:37

问题


I have to generate some word docs with PHP and need to change the line spacing and line height.

Setting the line height is simple, but I have no idea how I change change the line spacing from "multiple" to "single". (I hope I use the right terms here because I got only a german word version...)

I've added a picture to make clear which option I mean...


回答1:


You can set the spacing styles (including line spacing) with the paragraph style - you just need to define the value in twips... for example:

$paragraphOptions = array('space' => array('line' => 1000));

This style option seems to be missing from the referenced styles documentation but it is documented in the source code that line spacing is modifiable Paragraph style src



来源:https://stackoverflow.com/questions/31741458/phpword-set-line-spacing-to-single

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!