本文整理汇总了Python中reportlab.platypus.paraparser.ParaFrag类的典型用法代码示例。如果您正苦于以下问题:Python ParaFrag类的具体用法?Python ParaFrag怎么用?Python ParaFrag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ParaFrag类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: clone
def clone(self, **kwargs):
n = ParaFrag(**self.__dict__)
if kwargs:
d = n.__dict__
d.update(kwargs)
# This else could cause trouble in Paragraphs with images etc.
if "cbDefn" in d:
del d["cbDefn"]
n.bulletText = None
return n
开发者ID:AntycSolutions,项目名称:xhtml2pdf,代码行数:10,代码来源:context.py
示例2: setUp
def setUp(self):
style=ParaFrag()
style.fontName='Times-Roman'
style.fontSize = 12
style.textColor = black
style.bulletFontName = black
style.bulletFontName='Times-Roman'
style.bulletFontSize=12
style.bulletOffsetY=3
self.style = style
开发者ID:makinacorpus,项目名称:reportlab-ecomobile,代码行数:10,代码来源:test_platypus_paraparser.py
示例3: setUp
def setUp(self):
style = ParaFrag()
style.fontName = "Times-Roman"
style.fontSize = 12
style.textColor = black
style.bulletFontName = black
style.bulletFontName = "Times-Roman"
style.bulletFontSize = 12
style.bulletOffsetY = 3
style.textTransform = None
self.style = style
开发者ID:nakagami,项目名称:reportlab,代码行数:11,代码来源:test_platypus_paraparser.py
示例4: getParaFrag
def getParaFrag(style):
frag = ParaFrag()
frag.sub = 0
frag.super = 0
frag.rise = 0
frag.underline = 0 # XXX Need to be able to set color to fit CSS tests
frag.strike = 0
frag.greek = 0
frag.link = None
frag.text = ""
frag.fontName = "Times-Roman"
frag.fontName, frag.bold, frag.italic = ps2tt(style.fontName)
frag.fontSize = style.fontSize
frag.textColor = style.textColor
# Extras
frag.leading = 0
frag.letterSpacing = "normal"
frag.leadingSource = "150%"
frag.leadingSpace = 0
frag.backColor = None
frag.spaceBefore = 0
frag.spaceAfter = 0
frag.leftIndent = 0
frag.rightIndent = 0
frag.firstLineIndent = 0
frag.keepWithNext = False
frag.alignment = TA_LEFT
frag.vAlign = None
frag.borderWidth = 1
frag.borderStyle = None
frag.borderPadding = 0
frag.borderColor = None
frag.borderLeftWidth = frag.borderWidth
frag.borderLeftColor = frag.borderColor
frag.borderLeftStyle = frag.borderStyle
frag.borderRightWidth = frag.borderWidth
frag.borderRightColor = frag.borderColor
frag.borderRightStyle = frag.borderStyle
frag.borderTopWidth = frag.borderWidth
frag.borderTopColor = frag.borderColor
frag.borderTopStyle = frag.borderStyle
frag.borderBottomWidth = frag.borderWidth
frag.borderBottomColor = frag.borderColor
frag.borderBottomStyle = frag.borderStyle
frag.paddingLeft = 0
frag.paddingRight = 0
frag.paddingTop = 0
frag.paddingBottom = 0
frag.listStyleType = None
frag.listStyleImage = None
frag.whiteSpace = "normal"
frag.wordWrap = None
frag.pageNumber = False
frag.pageCount = False
frag.height = None
frag.width = None
frag.bulletIndent = 0
frag.bulletText = None
frag.bulletFontName = "Helvetica"
frag.zoom = 1.0
frag.outline = False
frag.outlineLevel = 0
frag.outlineOpen = False
frag.insideStaticFrame = 0
return frag
开发者ID:AntycSolutions,项目名称:xhtml2pdf,代码行数:77,代码来源:context.py
示例5: getParaFrag
def getParaFrag(style):
frag = ParaFrag()
frag.sub = 0
frag.super = 0
frag.rise = 0
frag.underline = 0
frag.strike = 0
frag.greek = 0
frag.link = None
frag.text = ""
# frag.lineBreak = 0
# if bullet:
# frag.fontName, frag.bold, frag.italic = ps2tt(style.bulletFontName)
# frag.fontSize = style.bulletFontSize
# frag.textColor = hasattr(style,'bulletColor') and style.bulletColor or style.textColor
# else:
frag.fontName, frag.bold, frag.italic = ps2tt(style.fontName)
frag.fontName = "Times-Roman"
frag.fontSize = style.fontSize
frag.textColor = style.textColor
# Extras
frag.leading = 0
frag.leadingSource = "150%"
frag.backColor = white
frag.borderWidth = 0
frag.borderPadding = 0
frag.borderColor = None
frag.spaceBefore = 0
frag.spaceAfter = 0
frag.leftIndent = 0
frag.rightIndent = 0
frag.firstLineIndent = 0
frag.keepWithNext = False
frag.alignment = TA_LEFT
frag.vAlign = None
frag.borderLeftWidth = 0
frag.borderLeftColor = None
frag.borderLeftStyle = None
frag.borderRightWidth = 0
frag.borderRightColor = None
frag.borderRightStyle = None
frag.borderTopWidth = 0
frag.borderTopColor = None
frag.borderTopStyle = None
frag.borderBottomWidth = 0
frag.borderBottomColor = None
frag.borderBottomStyle = None
frag.paddingLeft = 0
frag.paddingRight = 0
frag.paddingTop = 0
frag.paddingBottom = 0
frag.listStyleType = None
frag.whiteSpace = "normal"
frag.pageNumber = False
frag.height = None
frag.width = None
frag.bulletIndent = 0
frag.bulletText = None
frag.zoom = 1.0
frag.outline = False
frag.outlineLevel = 0
frag.outlineOpen = False
return frag
开发者ID:ahmedsalman,项目名称:django-project,代码行数:73,代码来源:pisa_context.py
示例6: getParaFrag
def getParaFrag(style):
frag = ParaFrag()
set_value(frag,
('sub', 'super', 'rise', 'underline', 'strike', 'greek',
'leading', 'leadingSpace', 'spaceBefore',
'spaceAfter', 'leftIndent', 'rightIndent', 'firstLineIndent',
'borderPadding', 'paddingLeft', 'paddingRight',
'paddingTop', 'paddingBottom', 'bulletIndent',
'insideStaticFrame', 'outlineLevel'
),
0)
set_value(frag,
('backColor', 'vAlign', 'link', 'borderStyle',
'borderColor', 'listStyleType', 'listStyleImage',
'wordWrap', 'height', 'width', 'bulletText'
),
None
)
set_value(frag,
('pageNumber', 'pageCount', 'outline',
'outlineOpen', 'keepWithNext'),
False)
frag.text = ""
frag.fontName = "Times-Roman"
frag.fontName, frag.bold, frag.italic = ps2tt(style.fontName)
frag.fontSize = style.fontSize
frag.textColor = style.textColor
# Extras
frag.letterSpacing = "normal"
frag.leadingSource = "150%"
frag.alignment = TA_LEFT
frag.borderWidth = 1
frag.borderLeftWidth = frag.borderWidth
frag.borderLeftColor = frag.borderColor
frag.borderLeftStyle = frag.borderStyle
frag.borderRightWidth = frag.borderWidth
frag.borderRightColor = frag.borderColor
frag.borderRightStyle = frag.borderStyle
frag.borderTopWidth = frag.borderWidth
frag.borderTopColor = frag.borderColor
frag.borderTopStyle = frag.borderStyle
frag.borderBottomWidth = frag.borderWidth
frag.borderBottomColor = frag.borderColor
frag.borderBottomStyle = frag.borderStyle
frag.whiteSpace = "normal"
frag.bulletFontName = "Helvetica"
frag.zoom = 1.0
return frag
开发者ID:mokop,项目名称:xhtml2pdf,代码行数:55,代码来源:context.py
示例7: elem2frags
def elem2frags(self, elem, style):
# print "elem2frags(%s)" % elem
frag = ParaFrag()
frag.text = ""
frag.fontName = style.fontName
frag.fontSize = style.fontSize
frag.textColor = style.textColor
frag.rise = style.rise
frag.underline = style.underline
frag.strike = 0 # added for reportlab 2.0
frag.link = None # added for reportlab 2.0
if elem.__class__ == html.CDATA:
frag.text = " ".join(elem.text.split())
if elem.text.startswith(" "):
frag.text = " " + frag.text
if elem.text.endswith(" "):
frag.text += " "
# frag.text=elem.text
yield frag
return
if elem.__class__ == html.BR:
# frag.text='\n'
frag.lineBreak = True
yield frag
return
assert hasattr(elem, "content")
if elem.__class__ in (html.EM, html.I):
family, bold, italic = ps2tt(frag.fontName)
frag.fontName = tt2ps(family, bold, 1)
# frag.fontName=frag.fontName+"-Italic"
elif elem.__class__ == html.TT:
family, bold, italic = ps2tt(frag.fontName)
frag.fontName = tt2ps("Courier", bold, italic)
elif elem.__class__ == html.B:
family, bold, italic = ps2tt(frag.fontName)
frag.fontName = tt2ps(family, 1, italic)
elif elem.__class__ == html.U:
frag.underline = True
elif elem.__class__ == html.SUP:
frag.rise = True
else:
raise "Cannot handle <%s> inside a paragraph" % elem.tag()
## for e in elem.content:
## if e.__class__ == html.CDATA:
## frag.text += e.text
## else:
## for ee in elem.content:
## for f in self.elem2frags(ee,frag):
## yield f
for e in elem.content:
for f in self.elem2frags(e, frag):
yield f
yield frag
开发者ID:BackupTheBerlios,项目名称:lino-svn,代码行数:55,代码来源:pdf.py
示例8: getParaFrag
def getParaFrag(style):
frag = ParaFrag()
frag.sub = 0
frag.super = 0
frag.rise = 0
frag.underline = 0 # XXX Need to be able to set color to fit CSS tests
frag.strike = 0
frag.greek = 0
frag.link = None
frag.text = ""
# frag.lineBreak = 0
#if bullet:
# frag.fontName, frag.bold, frag.italic = ps2tt(style.bulletFontName)
# frag.fontSize = style.bulletFontSize
# frag.textColor = hasattr(style,'bulletColor') and style.bulletColor or style.textColor
#else:
frag.fontName = "Times-Roman"
frag.fontName, frag.bold, frag.italic = ps2tt(style.fontName)
frag.fontSize = style.fontSize
frag.textColor = style.textColor
# fontName, bold, italic, fontSize, textColor
# are all that is set on frag from a passed in style
# Extras
frag.leading = 0
frag.leadingSource = "150%"
frag.leadingSpace = 0
frag.backColor = None
frag.spaceBefore = 0
frag.spaceAfter = 0
frag.leftIndent = 0
frag.rightIndent = 0
frag.firstLineIndent = 0
frag.keepWithNext = False
frag.alignment = TA_LEFT
frag.vAlign = None
frag.borderWidth = 1
frag.borderStyle = None
frag.borderPadding = 0
frag.borderColor = None
frag.borderLeftWidth = frag.borderWidth
frag.borderLeftColor = frag.borderColor
frag.borderLeftStyle = frag.borderStyle
frag.borderRightWidth = frag.borderWidth
frag.borderRightColor = frag.borderColor
frag.borderRightStyle = frag.borderStyle
frag.borderTopWidth = frag.borderWidth
frag.borderTopColor = frag.borderColor
frag.borderTopStyle = frag.borderStyle
frag.borderBottomWidth = frag.borderWidth
frag.borderBottomColor = frag.borderColor
frag.borderBottomStyle = frag.borderStyle
frag.paddingLeft = 0
frag.paddingRight = 0
frag.paddingTop = 0
frag.paddingBottom = 0
frag.listStyleType = None
frag.listStyleImage = None
frag.whiteSpace = "normal"
frag.pageNumber = False
frag.height = None
frag.width = None
frag.bulletIndent = 0
frag.bulletText = None
frag.bulletFontName = "Helvetica"
frag.zoom = 1.0
frag.outline = False
frag.outlineLevel = 0
frag.outlineOpen = False
frag.keepInFrameMode = "shrink"
#frag.keepInFrameMaxWidth = None
#frag.keepInFrameMaxHeight = None
frag.insideStaticFrame = 0
return frag
开发者ID:altalang,项目名称:pisa,代码行数:88,代码来源:pisa_context.py
注:本文中的reportlab.platypus.paraparser.ParaFrag类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论