在段落中插入水平线 [ Reportlab ]

2024-03-29 09:12:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我看到了一些使用表添加水平线的示例代码,但是我想知道是否有一种更快的方法来使用段落。我查阅了reportlab文档,但是我能找到任何东西。在

所以我的问题是,是否可以使用段落来添加一条水平线?在


Tags: 方法代码文档示例段落reportlab水平线
1条回答
网友
1楼 · 发布于 2024-03-29 09:12:50

最快的方法可能是使用HRFlowable这个可流动的尝试来模拟HTML的行为<HR>只是为了给你一个指示,这就是它在HTML中的外观:


由于这个函数没有被记录,我能做的最好的就是让你参考source code,它显示了所有可用的选项。在

下面是我自己试图记录这个流动的

HRFlowable(width="80%", thickness=1, lineCap='round', color=lightgrey, spaceBefore=1, spaceAfter=1, hAlign='CENTER', vAlign='BOTTOM', dash=None)

width: Width of the horizontal line
thickness: Height of the horizontal line
lineCap: Determines whether a terminating line ends in a square exactly at the vertex, a square over the vertex or a half circle over the vertex.
color: Straight forward
spaceBefore: ??? Isn't used in the source code
spaceAfter: ??? Isn't used in the source code
hAlign: ??? Isn't used in the source code
vAlign: ??? Isn't used in the source code
dash: Allows the line to be broken into dots or dashes.

相关问题 更多 >