1
我有一個Table
2細胞,每一個裏面有一個Paragraph
溢出隱藏在一個段落在ReportLab的
from reportlab.platypus import Paragraph, Table, TableStyle
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.units import cm
table_style_footer = TableStyle(
[
('LEFTPADDING', (0, 0), (-1, -1), 0),
('RIGHTPADDING', (0, 0), (-1, -1), 0),
('TOPPADDING', (0, 0), (-1, -1), 0),
('BOTTOMPADDING', (0, 0), (-1, -1), 0),
('BOX', (0, 0), (-1, -1), 1, (0, 0, 0)),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
]
)
style_p_footer = ParagraphStyle('Normal')
style_p_footer.fontName = 'Arial'
style_p_footer.fontSize = 8
style_p_footer.leading = 10
Table([
[
Paragraph('Send To:', style_p_footer),
Paragraph('Here should be a variable with long content', style_p_footer)
]
],
[1.7 * cm, 4.8 * cm],
style=table_style_footer
)
我需要隱藏段落的溢出內容,但段落,而不是隱藏溢出內容做一個斷線。
完美的作品。我有一個問題,我怎麼能'para_fragment.kind'與'0'不同? @ B8vrede –
添加內聯分頁符將導致它變得友善1 :) – B8vrede
「添加內聯分頁符」像\ n? :d –