当前位置: 首页>>代码示例>>Python>>正文


Python ParagraphStyle.borderRadius方法代码示例

本文整理汇总了Python中reportlab.lib.styles.ParagraphStyle.borderRadius方法的典型用法代码示例。如果您正苦于以下问题:Python ParagraphStyle.borderRadius方法的具体用法?Python ParagraphStyle.borderRadius怎么用?Python ParagraphStyle.borderRadius使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在reportlab.lib.styles.ParagraphStyle的用法示例。


在下文中一共展示了ParagraphStyle.borderRadius方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: cover

# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import borderRadius [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))
开发者ID:neurospin,项目名称:pyconnectomist,代码行数:22,代码来源:pdftools.py

示例2: _test0

# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import borderRadius [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 &lt;br/&gt; tests(align=%s)' % align, h1))
        a(Paragraph('First off no br tags',h3))
        a(Paragraph(_text1,bts))
        a(Paragraph("&lt;br/&gt; after 'the' in line 4",h3))
        a(Paragraph(_text1.replace('forms of the','forms of the<br/>',1),bts))
        a(Paragraph("2*&lt;br/&gt; after 'the' in line 4",h3))
        a(Paragraph(_text1.replace('forms of the','forms of the<br/><br/>',1),bts))
        a(Paragraph("&lt;br/&gt; after 'I suggested ' in line 5",h3))
        a(Paragraph(_text1.replace('I suggested ','I suggested<br/>',1),bts))
        a(Paragraph("2*&lt;br/&gt; after 'I suggested ' in line 5",h3))
        a(Paragraph(_text1.replace('I suggested ','I suggested<br/><br/>',1),bts))
        a(Paragraph("&lt;br/&gt; at the end of the paragraph!",h3))
        a(Paragraph("""text one<br/>text two<br/>""",bts))
        a(Paragraph("Border with &lt;br/&gt; 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 &lt;br/&gt; 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)
开发者ID:FatihZor,项目名称:infernal-twin,代码行数:95,代码来源:test_platypus_breaking.py

示例3: _test0

# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import borderRadius [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 &lt;br/&gt; tests", h1))
    a(Paragraph("First off no br tags", h3))
    a(Paragraph(_text1, bt))
    a(Paragraph("&lt;br/&gt; after 'the' in line 4", h3))
    a(Paragraph(_text1.replace("forms of the", "forms of the<br/>", 1), bt))
    a(Paragraph("2*&lt;br/&gt; after 'the' in line 4", h3))
    a(Paragraph(_text1.replace("forms of the", "forms of the<br/><br/>", 1), bt))
    a(Paragraph("&lt;br/&gt; after 'I suggested ' in line 5", h3))
    a(Paragraph(_text1.replace("I suggested ", "I suggested<br/>", 1), bt))
    a(Paragraph("2*&lt;br/&gt; after 'I suggested ' in line 5", h3))
    a(Paragraph(_text1.replace("I suggested ", "I suggested<br/><br/>", 1), bt))
    a(Paragraph("&lt;br/&gt; at the end of the paragraph!", h3))
    a(Paragraph("""text one<br/>text two<br/>""", bt))
    a(Paragraph("Border with &lt;nr/&gt; 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 &lt;nr/&gt; 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)
开发者ID:radical-software,项目名称:radicalspam,代码行数:99,代码来源:test_platypus_breaking.py


注:本文中的reportlab.lib.styles.ParagraphStyle.borderRadius方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。