在段落中插入水平线 [ Reportlab ]
Inserting Horizontal Line within Paragraph [ Reportlab ]
我看到了一些使用 Table 添加水平线的示例代码,但我想知道是否有使用段落的更快方法。我查看了 reportlab 文档,但是我能找到任何东西。
所以我的问题是,是否可以使用段落来添加水平线?
最快的方法可能是使用 HRFlowable
这个可流动的尝试来模仿 HTML <HR>
的行为只是给你一个指示,这就是它在 HTML:
由于没有记录此功能,我能做的最好的事情就是让您参考显示所有可用选项的 source code。
下面是我自己尝试记录这个 flowable
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.
我看到了一些使用 Table 添加水平线的示例代码,但我想知道是否有使用段落的更快方法。我查看了 reportlab 文档,但是我能找到任何东西。
所以我的问题是,是否可以使用段落来添加水平线?
最快的方法可能是使用 HRFlowable
这个可流动的尝试来模仿 HTML <HR>
的行为只是给你一个指示,这就是它在 HTML:
由于没有记录此功能,我能做的最好的事情就是让您参考显示所有可用选项的 source code。
下面是我自己尝试记录这个 flowable
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.