本文整理汇总了Python中reportlab.lib.styles.ParagraphStyle.backColor方法的典型用法代码示例。如果您正苦于以下问题:Python ParagraphStyle.backColor方法的具体用法?Python ParagraphStyle.backColor怎么用?Python ParagraphStyle.backColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reportlab.lib.styles.ParagraphStyle
的用法示例。
在下文中一共展示了ParagraphStyle.backColor方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: toParagraphStyle
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import backColor [as 别名]
def toParagraphStyle(self, first, full=False):
style = ParagraphStyle('default%d' % self.UID(), keepWithNext=first.keepWithNext)
style.fontName = first.fontName
style.fontSize = first.fontSize
style.leading = max(first.leading, first.fontSize * 1.25)
style.backColor = first.backColor
style.spaceBefore = first.spaceBefore
style.spaceAfter = first.spaceAfter
style.leftIndent = first.leftIndent
style.rightIndent = first.rightIndent
style.firstLineIndent = first.firstLineIndent
style.textColor = first.textColor
style.alignment = first.alignment
style.bulletFontName = first.bulletFontName or first.fontName
style.bulletFontSize = first.fontSize
style.bulletIndent = first.bulletIndent
# Border handling for Paragraph
style.borderWidth = 0
if getBorderStyle(first.borderTopStyle):
style.borderWidth = max(first.borderLeftWidth, first.borderRightWidth, first.borderTopWidth, first.borderBottomWidth)
style.borderPadding = first.borderPadding # + first.borderWidth
style.borderColor = first.borderTopColor
# If no border color is given, the text color is used (XXX Tables!)
if (style.borderColor is None) and style.borderWidth:
style.borderColor = first.textColor
if full:
style.fontName = tt2ps(first.fontName, first.bold, first.italic)
return style
示例2: addPara
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import backColor [as 别名]
def addPara(self, force=False):
# Cleanup the trail
for frag in reversed(self.fragList):
frag.text = frag.text.rstrip()
if frag.text:
break
if force or (self.text.strip() and self.fragList):
# Strip trailing whitespaces
# for f in self.fragList:
# f.text = f.text.lstrip()
# if f.text:
# break
# self.fragList[-1].lineBreak = self.fragList[-1].text.rstrip()
# Update paragraph style by style of first fragment
first = self.fragBlock
style = ParagraphStyle("default%d" % self.UID(), keepWithNext=first.keepWithNext)
style.fontName = first.fontName
style.fontSize = first.fontSize
style.leading = max(first.leading, first.fontSize * 1.25)
style.backColor = first.backColor
style.spaceBefore = first.spaceBefore
style.spaceAfter = first.spaceAfter
style.leftIndent = first.leftIndent
style.rightIndent = first.rightIndent
style.firstLineIndent = first.firstLineIndent
style.alignment = first.alignment
style.bulletFontName = first.fontName
style.bulletFontSize = first.fontSize
style.bulletIndent = first.bulletIndent
style.borderWidth = max(
first.borderLeftWidth, first.borderRightWidth, first.borderTopWidth, first.borderBottomWidth
)
style.borderPadding = first.borderPadding # + first.borderWidth
style.borderColor = first.borderTopColor
# borderRadius: None,
# print repr(self.text.strip()), style.leading, "".join([repr(x.text) for x in self.fragList])
# print first.leftIndent, first.listStyleType,repr(self.text)
# Add paragraph to story
para = PmlParagraph(
self.text, style, frags=self.fragAnchor + self.fragList, bulletText=copy.copy(first.bulletText)
)
para.outline = frag.outline
para.outlineLevel = frag.outlineLevel
para.outlineOpen = frag.outlineOpen
self.addStory(para)
self.fragAnchor = []
first.bulletText = None
self.clearFrag()
示例3: toParagraphStyle
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import backColor [as 别名]
def toParagraphStyle(self, first):
style = ParagraphStyle('default%d' % self.UID(), keepWithNext=first.keepWithNext)
style.fontName = first.fontName
style.fontSize = first.fontSize
style.letterSpacing = first.letterSpacing
style.leading = max(first.leading + first.leadingSpace, first.fontSize * 1.25)
style.backColor = first.backColor
style.spaceBefore = first.spaceBefore
style.spaceAfter = first.spaceAfter
style.leftIndent = first.leftIndent
style.rightIndent = first.rightIndent
style.firstLineIndent = first.firstLineIndent
style.textColor = first.textColor
style.alignment = first.alignment
style.bulletFontName = first.bulletFontName or first.fontName
style.bulletFontSize = first.fontSize
style.bulletIndent = first.bulletIndent
style.wordWrap = first.wordWrap
# Border handling for Paragraph
# Transfer the styles for each side of the border, *not* the whole
# border values that reportlab supports. We'll draw them ourselves in
# PmlParagraph.
style.borderTopStyle = first.borderTopStyle
style.borderTopWidth = first.borderTopWidth
style.borderTopColor = first.borderTopColor
style.borderBottomStyle = first.borderBottomStyle
style.borderBottomWidth = first.borderBottomWidth
style.borderBottomColor = first.borderBottomColor
style.borderLeftStyle = first.borderLeftStyle
style.borderLeftWidth = first.borderLeftWidth
style.borderLeftColor = first.borderLeftColor
style.borderRightStyle = first.borderRightStyle
style.borderRightWidth = first.borderRightWidth
style.borderRightColor = first.borderRightColor
# If no border color is given, the text color is used (XXX Tables!)
if (style.borderTopColor is None) and style.borderTopWidth:
style.borderTopColor = first.textColor
if (style.borderBottomColor is None) and style.borderBottomWidth:
style.borderBottomColor = first.textColor
if (style.borderLeftColor is None) and style.borderLeftWidth:
style.borderLeftColor = first.textColor
if (style.borderRightColor is None) and style.borderRightWidth:
style.borderRightColor = first.textColor
style.borderPadding = first.borderPadding
style.paddingTop = first.paddingTop
style.paddingBottom = first.paddingBottom
style.paddingLeft = first.paddingLeft
style.paddingRight = first.paddingRight
style.fontName = tt2ps(first.fontName, first.bold, first.italic)
return style
示例4: cover
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import backColor [as 别名]
def cover(self):
""" Display a cover.
"""
# Define a style for the cover
cover = ParagraphStyle("Cover")
cover.textColor = "black"
cover.borderColor = "black"
cover.borderPadding = 80
cover.borderWidth = 1
cover.alignment = TA_CENTER
cover.fontSize = 30
cover.borderRadius = 20
cover.backColor = "gray"
cover.leading = 40
pagesize = self.templates["OneCol"]["pagesize"]
self.story.append(Cover(pagesize[0], pagesize[1] / 3, self.author,
self.client, self.poweredby, self.project,
self.timepoint, self.subject, self.date))
self.story.append(Spacer(0, pagesize[1] / 2))
self.story.append(Paragraph(self.title, cover))
示例5: _test0
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import backColor [as 别名]
def _test0(self):
"This makes one long multi-page paragraph."
# Build story.
story = []
a = story.append
styleSheet = getSampleStyleSheet()
h1 = styleSheet['Heading1']
h1.pageBreakBefore = 1
h1.keepWithNext = 1
h2 = styleSheet['Heading2']
h2.frameBreakBefore = 1
h2.keepWithNext = 1
h3 = styleSheet['Heading3']
h3.backColor = colors.cyan
h3.keepWithNext = 1
bt = styleSheet['BodyText']
btj = ParagraphStyle('bodyText1j',parent=bt,alignment=TA_JUSTIFY)
btr = ParagraphStyle('bodyText1r',parent=bt,alignment=TA_RIGHT)
btc = ParagraphStyle('bodyText1c',parent=bt,alignment=TA_CENTER)
a(Paragraph("""
<a name='top'/>Subsequent pages test pageBreakBefore, frameBreakBefore and
keepTogether attributes. Generated at %s. The number in brackets
at the end of each paragraph is its position in the story. (%d)""" % (
time.ctime(time.time()), len(story)), bt))
for i in range(10):
a(Paragraph('Heading 1 always starts a new page (%d)' % len(story), h1))
for j in range(3):
a(Paragraph('Heading1 paragraphs should always'
'have a page break before. Heading 2 on the other hand'
'should always have a FRAME break before (%d)' % len(story), bt))
a(Paragraph('Heading 2 always starts a new frame (%d)' % len(story), h2))
a(Paragraph('Heading1 paragraphs should always'
'have a page break before. Heading 2 on the other hand'
'should always have a FRAME break before (%d)' % len(story), bt))
for j in range(3):
a(Paragraph(randomText(theme=PYTHON, sentences=2)+' (%d)' % len(story), bt))
a(Paragraph('I should never be at the bottom of a frame (%d)' % len(story), h3))
a(Paragraph(randomText(theme=PYTHON, sentences=1)+' (%d)' % len(story), bt))
for align,bts in [('left',bt),('JUSTIFIED',btj),('RIGHT',btr),('CENTER',btc)]:
a(Paragraph('Now we do <br/> tests(align=%s)' % align, h1))
a(Paragraph('First off no br tags',h3))
a(Paragraph(_text1,bts))
a(Paragraph("<br/> after 'the' in line 4",h3))
a(Paragraph(_text1.replace('forms of the','forms of the<br/>',1),bts))
a(Paragraph("2*<br/> after 'the' in line 4",h3))
a(Paragraph(_text1.replace('forms of the','forms of the<br/><br/>',1),bts))
a(Paragraph("<br/> after 'I suggested ' in line 5",h3))
a(Paragraph(_text1.replace('I suggested ','I suggested<br/>',1),bts))
a(Paragraph("2*<br/> after 'I suggested ' in line 5",h3))
a(Paragraph(_text1.replace('I suggested ','I suggested<br/><br/>',1),bts))
a(Paragraph("<br/> at the end of the paragraph!",h3))
a(Paragraph("""text one<br/>text two<br/>""",bts))
a(Paragraph("Border with <br/> at the end of the paragraph!",h3))
bt1 = ParagraphStyle('bodyText1',bts)
bt1.borderWidth = 0.5
bt1.borderColor = colors.toColor('red')
bt1.backColor = colors.pink
bt1.borderRadius = 2
bt1.borderPadding = 3
a(Paragraph("""text one<br/>text two<br/>""",bt1))
a(Paragraph("Border no <br/> at the end of the paragraph!",h3))
bt1 = ParagraphStyle('bodyText1',bts)
bt1.borderWidth = 0.5
bt1.borderColor = colors.toColor('red')
bt1.backColor = colors.pink
bt1.borderRadius = 2
bt1.borderPadding = 3
a(Paragraph("""text one<br/>text two""",bt1))
a(Paragraph("Different border style!",h3))
bt2 = ParagraphStyle('bodyText1',bt1)
bt2.borderWidth = 1.5
bt2.borderColor = colors.toColor('blue')
bt2.backColor = colors.gray
bt2.borderRadius = 3
bt2.borderPadding = 3
a(Paragraph("""text one<br/>text two<br/>""",bt2))
for i in 0, 1, 2:
P = Paragraph("""This is a paragraph with <font color='blue'><a href='#top'>with an incredibly
long and boring link in side of it that
contains lots and lots of stupidly boring and worthless information.
So that we can split the link and see if we get problems like Dinu's.
I hope we don't, but you never do Know.</a></font>""",bt)
a(P)
doc = MyDocTemplate(outputfile('test_platypus_breaking.pdf'))
doc.multiBuild(story)
示例6: _test0
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import backColor [as 别名]
def _test0(self):
"This makes one long multi-page paragraph."
# Build story.
story = []
a = story.append
styleSheet = getSampleStyleSheet()
h1 = styleSheet["Heading1"]
h1.pageBreakBefore = 1
h1.keepWithNext = 1
h2 = styleSheet["Heading2"]
h2.frameBreakBefore = 1
h2.keepWithNext = 1
h3 = styleSheet["Heading3"]
h3.backColor = colors.cyan
h3.keepWithNext = 1
bt = styleSheet["BodyText"]
a(
Paragraph(
"""
Subsequent pages test pageBreakBefore, frameBreakBefore and
keepTogether attributes. Generated at %s. The number in brackets
at the end of each paragraph is its position in the story. (%d)"""
% (time.ctime(time.time()), len(story)),
bt,
)
)
for i in xrange(10):
a(Paragraph("Heading 1 always starts a new page (%d)" % len(story), h1))
for j in xrange(3):
a(
Paragraph(
"Heading1 paragraphs should always"
"have a page break before. Heading 2 on the other hand"
"should always have a FRAME break before (%d)" % len(story),
bt,
)
)
a(Paragraph("Heading 2 always starts a new frame (%d)" % len(story), h2))
a(
Paragraph(
"Heading1 paragraphs should always"
"have a page break before. Heading 2 on the other hand"
"should always have a FRAME break before (%d)" % len(story),
bt,
)
)
for j in xrange(3):
a(Paragraph(randomText(theme=PYTHON, sentences=2) + " (%d)" % len(story), bt))
a(Paragraph("I should never be at the bottom of a frame (%d)" % len(story), h3))
a(Paragraph(randomText(theme=PYTHON, sentences=1) + " (%d)" % len(story), bt))
a(Paragraph("Now we do <br/> tests", h1))
a(Paragraph("First off no br tags", h3))
a(Paragraph(_text1, bt))
a(Paragraph("<br/> after 'the' in line 4", h3))
a(Paragraph(_text1.replace("forms of the", "forms of the<br/>", 1), bt))
a(Paragraph("2*<br/> after 'the' in line 4", h3))
a(Paragraph(_text1.replace("forms of the", "forms of the<br/><br/>", 1), bt))
a(Paragraph("<br/> after 'I suggested ' in line 5", h3))
a(Paragraph(_text1.replace("I suggested ", "I suggested<br/>", 1), bt))
a(Paragraph("2*<br/> after 'I suggested ' in line 5", h3))
a(Paragraph(_text1.replace("I suggested ", "I suggested<br/><br/>", 1), bt))
a(Paragraph("<br/> at the end of the paragraph!", h3))
a(Paragraph("""text one<br/>text two<br/>""", bt))
a(Paragraph("Border with <nr/> at the end of the paragraph!", h3))
bt1 = ParagraphStyle("bodyText1", bt)
bt1.borderWidth = 0.5
bt1.borderColor = colors.toColor("red")
bt1.backColor = colors.pink
bt1.borderRadius = 2
bt1.borderPadding = 3
a(Paragraph("""text one<br/>text two<br/>""", bt1))
a(Paragraph("Border no <nr/> at the end of the paragraph!", h3))
bt1 = ParagraphStyle("bodyText1", bt)
bt1.borderWidth = 0.5
bt1.borderColor = colors.toColor("red")
bt1.backColor = colors.pink
bt1.borderRadius = 2
bt1.borderPadding = 3
a(Paragraph("""text one<br/>text two""", bt1))
a(Paragraph("Different border style!", h3))
bt2 = ParagraphStyle("bodyText1", bt1)
bt2.borderWidth = 1.5
bt2.borderColor = colors.toColor("blue")
bt2.backColor = colors.gray
bt2.borderRadius = 3
bt2.borderPadding = 3
a(Paragraph("""text one<br/>text two<br/>""", bt2))
doc = MyDocTemplate(outputfile("test_platypus_breaking.pdf"))
doc.multiBuild(story)
示例7: toParagraphStyle
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import backColor [as 别名]
def toParagraphStyle(self, first, full=False):
style = ParagraphStyle('default%d' % self.UID(), keepWithNext=first.keepWithNext)
style.fontName = first.fontName
style.fontSize = first.fontSize
style.leading = max(first.leading, first.fontSize * 1.25)
style.backColor = first.backColor
style.spaceBefore = first.spaceBefore
style.spaceAfter = first.spaceAfter
style.leftIndent = first.leftIndent
style.rightIndent = first.rightIndent
style.firstLineIndent = first.firstLineIndent
style.textColor = first.textColor
style.alignment = first.alignment
style.bulletFontName = first.bulletFontName or first.fontName
style.bulletFontSize = first.fontSize
style.bulletIndent = first.bulletIndent
# Border handling for Paragraph
# Transfer the styles for each side of the border, *not* the whole
# border values that reportlab supports. We'll draw them ourselves in
# PmlParagraph.
style.borderTopStyle = first.borderTopStyle
style.borderTopWidth = first.borderTopWidth
style.borderTopColor = first.borderTopColor
style.borderBottomStyle = first.borderBottomStyle
style.borderBottomWidth = first.borderBottomWidth
style.borderBottomColor = first.borderBottomColor
style.borderLeftStyle = first.borderLeftStyle
style.borderLeftWidth = first.borderLeftWidth
style.borderLeftColor = first.borderLeftColor
style.borderRightStyle = first.borderRightStyle
style.borderRightWidth = first.borderRightWidth
style.borderRightColor = first.borderRightColor
# If no border color is given, the text color is used (XXX Tables!)
if (style.borderTopColor is None) and style.borderTopWidth:
style.borderTopColor = first.textColor
if (style.borderBottomColor is None) and style.borderBottomWidth:
style.borderBottomColor = first.textColor
if (style.borderLeftColor is None) and style.borderLeftWidth:
style.borderLeftColor = first.textColor
if (style.borderRightColor is None) and style.borderRightWidth:
style.borderRightColor = first.textColor
style.borderPadding = first.borderPadding
style.paddingTop = first.paddingTop
style.paddingBottom = first.paddingBottom
style.paddingLeft = first.paddingLeft
style.paddingRight = first.paddingRight
# This is the old code replaced by the above, kept for reference
#style.borderWidth = 0
#if getBorderStyle(first.borderTopStyle):
# style.borderWidth = max(first.borderLeftWidth, first.borderRightWidth, first.borderTopWidth, first.borderBottomWidth)
# style.borderPadding = first.borderPadding # + first.borderWidth
# style.borderColor = first.borderTopColor
# # If no border color is given, the text color is used (XXX Tables!)
# if (style.borderColor is None) and style.borderWidth:
# style.borderColor = first.textColor
if full:
style.fontName = tt2ps(first.fontName, first.bold, first.italic)
return style
示例8: __init__
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import backColor [as 别名]
def __init__(self, data, colWidths=None, rowHeights=None, style=None,
repeatRows=0, repeatCols=0, splitByRow=1, emptyTableAction=None):
self.hAlign = 'CENTER'
self.vAlign = 'MIDDLE'
if type(data) not in _SeqTypes:
raise ValueError, "%s invalid data type" % self.identity()
self._nrows = nrows = len(data)
self._cellvalues = []
_seqCW = type(colWidths) in _SeqTypes
_seqRH = type(rowHeights) in _SeqTypes
if nrows: self._ncols = ncols = max(map(_rowLen,data))
elif colWidths and _seqCW: ncols = len(colWidths)
else: ncols = 0
if not emptyTableAction: emptyTableAction = rl_config.emptyTableAction
if not (nrows and ncols):
if emptyTableAction=='error':
raise ValueError, "%s must have at least a row and column" % self.identity()
elif emptyTableAction=='indicate':
self.__class__ = Preformatted
global _emptyTableStyle
if '_emptyTableStyle' not in globals().keys():
_emptyTableStyle = ParagraphStyle('_emptyTableStyle')
_emptyTableStyle.textColor = colors.red
_emptyTableStyle.backColor = colors.yellow
Preformatted.__init__(self,'%s(%d,%d)' % (self.__class__.__name__,nrows,ncols), _emptyTableStyle)
elif emptyTableAction=='ignore':
self.__class__ = Spacer
Spacer.__init__(self,0,0)
else:
raise ValueError, '%s bad emptyTableAction: "%s"' % (self.identity(),emptyTableAction)
return
self._cellvalues = data
if not _seqCW: colWidths = ncols*[colWidths]
elif len(colWidths) != ncols:
raise ValueError, "%s data error - %d columns in data but %d in grid" % (self.identity(),ncols, len(colWidths))
if not _seqRH: rowHeights = nrows*[rowHeights]
elif len(rowHeights) != nrows:
raise ValueError, "%s data error - %d rows in data but %d in grid" % (self.identity(),nrows, len(rowHeights))
for i in range(nrows):
if len(data[i]) != ncols:
raise ValueError, "%s not enough data points in row %d!" % (self.identity(),i)
self._rowHeights = self._argH = rowHeights
self._colWidths = self._argW = colWidths
cellrows = []
for i in range(nrows):
cellcols = []
for j in range(ncols):
cellcols.append(CellStyle(`(i,j)`))
cellrows.append(cellcols)
self._cellStyles = cellrows
self._bkgrndcmds = []
self._linecmds = []
self._spanCmds = []
self.repeatRows = repeatRows
self.repeatCols = repeatCols
self.splitByRow = splitByRow
if style:
self.setStyle(style)
示例9: __init__
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import backColor [as 别名]
Image of Cambridge Map.
'''
def __init__(self, xoffset=0):
self.xoffset = xoffset
def wrap(self, *args):
return (self.xoffset, 0)
def draw(self):
canvas = self.canv
canvas.drawImage("centre2_8000_rotated.jpg", -10,-260, width=400,height=280)
# Create the styles for the document
logoStyle = ParagraphStyle('normal')
logoStyle.fontSize=16
logoStyle.leading=15
logoStyle.rightindent=5
logoStyle.backColor='grey'
#logoStyle.textColor='white'
logoStyle.borderWidth=5
logoStyle.borderColor='grey'
rightStyle = ParagraphStyle('normal')
rightStyle.alignment = TA_RIGHT
rightStyle.spaceBefore = 10
paraStyle = ParagraphStyle('normal')
paraStyle.spaceAfter = 10
paraStyle.alignment = TA_JUSTIFY
medStyle = ParagraphStyle('normal')
medStyle.fontSize = 8
medStyle.leading = 8
示例10: createPDF
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import backColor [as 别名]
#.........这里部分代码省略.........
td_cell_right = ParagraphStyle('TableDataRight')
td_cell_right.spaceBefore = 3
td_cell_right.spaceAfter = 6
td_cell_right.fontSize = 10
td_cell_right.fontName = 'Times-Roman'
td_cell_right.alignment = TA_RIGHT
bullet_list = ParagraphStyle('BulletList')
bullet_list.spaceBefore = 4
bullet_list.spaceAfter = 4
bullet_list.fontName = 'Times-Roman'
bullet_list.bulletIndent = 5
bullet_list.leftIndent = 17
bullet_list.bulletFontSize = 12
blockquote = ParagraphStyle('Blockquote')
blockquote.leftIndent = 12
blockquote.rightIndent = 8
blockquote.spaceAfter = 6
blockquote.fontName = 'Times-Roman'
discreet = ParagraphStyle('Discreet')
discreet.fontSize = 9
discreet.textColor = HexColor('#717171')
discreet.spaceAfter = 12
discreet.spaceBefore = 1
callout = ParagraphStyle('Callout')
callout.fontSize = 10
callout.textColor = header_rgb
callout.spaceAfter = 20
callout.spaceBefore = 22
callout.backColor = callout_background_rgb
callout.borderColor = header_rgb
callout.borderWidth = 1
callout.borderPadding = (8, 12, 10, 12)
callout.rightIndent = 15
callout.leftIndent = 15
statement = ParagraphStyle('Statement')
statement.fontSize = 8
statement.fontName = 'Times-Roman'
statement.spaceAfter = 5
statement.leading = 10
description = ParagraphStyle('Description')
description.spaceBefore = 6
description.spaceAfter = 8
description.fontSize = 11
description.fontName = 'Helvetica-Bold'
description.leading = 13
padded_image = ParagraphStyle('PaddedImage')
padded_image.spaceBefore = 12
padded_image.spaceAfter = 12
single_line = ParagraphStyle('SingleLine')
single_line.fontSize = 9
single_line.fontName = 'Times-Roman'
single_line.spaceBefore = 0
single_line.spaceAfter = 0
single_line_cr = ParagraphStyle('SingleLineCR')
single_line_cr.fontSize = 9
single_line_cr.fontName = 'Times-Roman'
示例11: getSampleStyleSheet
# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import backColor [as 别名]
# Paragraph styles
ss = getSampleStyleSheet()
style_normal = ParagraphStyle('normal', fontName='Helvetica')
style_serial = ParagraphStyle('serial', parent=style_normal)
style_serial.alignment = 2
#style_normal = styles['Normal']
#style_normal.fontName = 'Helvetica'
style_title = ParagraphStyle('title')
style_title.fontName = 'Helvetica-Bold'
style_title.alignment = styles.TA_CENTER
style_labsur = ParagraphStyle('logo', parent=ss['h1'])
style_labsur.backColor = colors.silver
style_labsur.alignment = styles.TA_CENTER
style_address = ParagraphStyle('address', parent=style_normal)
# Table Styles
base_form_style = TableStyle([
('FACE', (0, 0), (0, -1), 'Helvetica-Bold'),
('FACE', (1, 0), (1, -1), 'Helvetica'),
('SIZE', (0, 0), (-1, -1), 10),
#('LEFTPADDING', (0, 0), (0, -1), 0),
#('LEFTPADDING', (1, 0), (1, -1), cm/3),
('RIGHTPADDING', (0, 0), (-1, -1), 0),
('TOPPADDING', (0, 0), (-1, -1), 0),
('BOTTOMPADDING', (0, 0), (-1, -1), 0),
])