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


Python ParagraphStyle.rightIndent方法代码示例

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


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

示例1: toParagraphStyle

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

示例2: build_encabezado

# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import rightIndent [as 别名]
def build_encabezado(datos_empresa = []):
    """
    Devuelve una lista de "Flowables" de reportlab con los datos de la empresa. 
    Los datos de la empresa se reciben como una lista de textos.
    """
    cabecera = []
    estilo_encabezado = ParagraphStyle("Encabezado", 
                                       parent = estilos["Heading2"])
    estilo_encabezado.rightIndent = PAGE_WIDTH * 0.25
    estilo_encabezado.alignment = enums.TA_JUSTIFY
    estilo_encabezado.spaceAfter = 0
    estilo_encabezado.spaceBefore = 4
    datos_empresa[0] = datos_empresa[0].upper()
    for linea in datos_empresa:
        if linea is datos_empresa[0]:
            estilo_encabezado.fontSize += 3
        p = Paragraph(escribe(linea), estilo_encabezado) 
        cabecera.append(p)
        estilo_encabezado.fontSize -= 1
        if estilo_encabezado.spaceAfter > -4:
            estilo_encabezado.spaceAfter -= 1
        estilo_encabezado.spaceBefore = estilo_encabezado.spaceAfter
        if linea is datos_empresa[0]:
            estilo_encabezado.fontSize -= 3
    return cabecera
开发者ID:pacoqueen,项目名称:upy,代码行数:27,代码来源:presupuesto2.py

示例3: addPara

# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import rightIndent [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()
开发者ID:ahmedsalman,项目名称:django-project,代码行数:61,代码来源:pisa_context.py

示例4: toParagraphStyle

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

示例5: build_encabezado

# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import rightIndent [as 别名]
def build_encabezado(datos_empresa = []):
    """
    Devuelve una lista de "Flowables" de reportlab con los datos de la empresa. 
    Los datos de la empresa se reciben como una lista de textos.
    """
    cabecera = []
    estilo_encabezado = ParagraphStyle("Encabezado", 
                                       parent = estilos["Heading2"])
    estilo_encabezado.rightIndent = PAGE_WIDTH * 0.4
    estilo_encabezado.alignment = enums.TA_CENTER
    estilo_encabezado.spaceAfter = estilo_encabezado.spaceBefore = 6
    for linea in datos_empresa:
        p = Paragraph(escribe(linea), estilo_encabezado) 
        cabecera.append(p)
        estilo_encabezado.fontSize -= 1
        if estilo_encabezado.spaceAfter > 0:
            estilo_encabezado.spaceAfter -= 1
        estilo_encabezado.spaceBefore = estilo_encabezado.spaceAfter
    return cabecera
开发者ID:pacoqueen,项目名称:upy,代码行数:21,代码来源:presupuesto.py

示例6: build_denominacion

# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import rightIndent [as 别名]
def build_denominacion(producto, albaran):
    head2 = build_head2("1. Denominación", 
                        ancho_linea = PAGE_WIDTH - 7.75 * cm, 
                        offset_linea = -1.12 * cm)
    try:
        factura = albaran.get_facturas()[0] # Si hay varias, la primera.
    except IndexError:
        factura = None
    estilo_denominacion = ParagraphStyle("Estilo denominación", 
                                         parent = estilos["Normal"])
    estilo_denominacion.fontSize = 8
    estilo_denominacion.rightIndent = 2.25*cm
    texto = Paragraph("Certificado de calidad asociado al producto %s "
                      "suministrado con el albarán %s%s." % (
                        producto.descripcion, 
                        albaran.numalbaran, 
                        factura 
                            and " y factura %s" % factura.numfactura 
                            or ""), 
                      estilo_denominacion)
    return head2, texto
开发者ID:pacoqueen,项目名称:ginn,代码行数:23,代码来源:informe_certificado_calidad.py

示例7: getExamples

# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import rightIndent [as 别名]
def getExamples():
    """Returns all the example flowable objects"""
    styleSheet = getSampleStyleSheet()

    story = []

    #make a style with indents and spacing
    sty = ParagraphStyle('obvious', None)
    sty.leftIndent = 18
    sty.rightIndent = 18
    sty.firstLineIndent = 18
    sty.spaceBefore = 6
    sty.spaceAfter = 6
    story.append(Paragraph("""Now for some demo stuff - we need some on this page,
        even before we explain the concepts fully""", styleSheet['BodyText']))
    p = Paragraph("""
        Platypus is all about fitting objects into frames on the page.  You
        are looking at a fairly simple Platypus paragraph in Debug mode.
        It has some gridlines drawn around it to show the left and right indents,
        and the space before and after, all of which are attributes set in
        the style sheet.  To be specific, this paragraph has left and
        right indents of 18 points, a first line indent of 36 points,
        and 6 points of space before and after itself.  A paragraph
        object fills the width of the enclosing frame, as you would expect.""", sty)

    p.debug = 1   #show me the borders
    story.append(p)

    story.append(Paragraph("""Same but with justification 1.5 extra leading and green text.""", styleSheet['BodyText']))
    p = Paragraph("""
        <para align=justify leading=+1.5 fg=green><font color=red>Platypus</font> is all about fitting objects into frames on the page.  You
        are looking at a fairly simple Platypus paragraph in Debug mode.
        It has some gridlines drawn around it to show the left and right indents,
        and the space before and after, all of which are attributes set in
        the style sheet.  To be specific, this paragraph has left and
        right indents of 18 points, a first line indent of 36 points,
        and 6 points of space before and after itself.  A paragraph
        object fills the width of the enclosing frame, as you would expect.</para>""", sty)

    p.debug = 1   #show me the borders
    story.append(p)

    story.append(platypus.XBox(4*inch, 0.75*inch,
            'This is a box with a fixed size'))

    story.append(Paragraph("""
        All of this is being drawn within a text frame which was defined
        on the page.  This frame is in 'debug' mode so you can see the border,
        and also see the margins which it reserves.  A frame does not have
        to have margins, but they have been set to 6 points each to create
        a little space around the contents.
        """, styleSheet['BodyText']))

    story.append(FrameBreak())

    #######################################################################
    #     Examples Page 2
    #######################################################################

    story.append(Paragraph("""
        Here's the base class for Flowable...
        """, styleSheet['Italic']))

    code = '''class Flowable:
        """Abstract base class for things to be drawn.  Key concepts:
    1. It knows its size
    2. It draws in its own coordinate system (this requires the
        base API to provide a translate() function.
        """
    def __init__(self):
        self.width = 0
        self.height = 0
        self.wrapped = 0

    def drawOn(self, canvas, x, y):
        "Tell it to draw itself on the canvas.  Do not override"
        self.canv = canvas
        self.canv.saveState()
        self.canv.translate(x, y)

        self.draw()   #this is the bit you overload

        self.canv.restoreState()
        del self.canv

    def wrap(self, availWidth, availHeight):
        """This will be called by the enclosing frame before objects
        are asked their size, drawn or whatever.  It returns the
        size actually used."""
        return (self.width, self.height)
    '''

    story.append(Preformatted(code, styleSheet['Code'], dedent=4))
    story.append(FrameBreak())
    #######################################################################
    #     Examples Page 3
    #######################################################################

    story.append(Paragraph(
                "Here are some examples of the remaining objects above.",
#.........这里部分代码省略.........
开发者ID:roytest001,项目名称:PythonCode,代码行数:103,代码来源:test_platypus_general.py

示例8: testRTLBullets

# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import rightIndent [as 别名]
        def testRTLBullets(self):
            try:
                import mwlib.ext
            except ImportError:
                pass

            font_name = getAFont()
            doc = SimpleDocTemplate(outputfile('test_rtl_bullets.pdf'),showBoundary=True)
            p_style = ParagraphStyle('default')
            p_style.leftIndent = 0
            p_style.rightIndent = 0

            list_styles=[ParagraphStyle('list%d' % n) for n in range(3)]
            all_styles = list_styles[:]
            all_styles.append(p_style)

            direction='rtl'

            for s in all_styles:
                s.fontSize = 15
                s.leading = s.fontSize*1.2
                s.fontName = font_name
                if direction=='rtl':
                    s.wordWrap = 'RTL'
                    s.alignment = TA_RIGHT
                else:
                    s.alignment = TA_JUSTIFY

            indent_amount = 20

            for list_lvl, list_style in enumerate(list_styles):
                list_lvl += 1
                list_style.bulletIndent = indent_amount*(list_lvl-1)

                if direction=='rtl':
                    list_style.rightIndent = indent_amount*list_lvl
                else:
                    list_style.leftIndent = indent_amount*list_lvl

            elements =[]

            TEXTS=[
                    b'\xd7\xa9\xd7\xa8 \xd7\x94\xd7\x91\xd7\x99\xd7\x98\xd7\x97\xd7\x95\xd7\x9f, \xd7\x94\xd7\x95\xd7\x90 \xd7\x94\xd7\xa9\xd7\xa8 \xd7\x94\xd7\x90\xd7\x97\xd7\xa8\xd7\x90\xd7\x99 \xd7\xa2\xd7\x9c \xd7\x9e\xd7\xa9\xd7\xa8\xd7\x93 \xd7\x96\xd7\x94. \xd7\xaa\xd7\xa4\xd7\xa7\xd7\x99\xd7\x93 \xd7\x96\xd7\x94 \xd7\xa0\xd7\x97\xd7\xa9\xd7\x91 \xd7\x9c\xd7\x90\xd7\x97\xd7\x93 \xd7\x94\xd7\xaa\xd7\xa4\xd7\xa7\xd7\x99\xd7\x93\xd7\x99\xd7\x9d \xd7\x94\xd7\x91\xd7\x9b\xd7\x99\xd7\xa8\xd7\x99\xd7\x9d \xd7\x91\xd7\x9e\xd7\x9e\xd7\xa9\xd7\x9c\xd7\x94. \xd7\x9c\xd7\xa9\xd7\xa8 \xd7\x94\xd7\x91\xd7\x99\xd7\x98\xd7\x97\xd7\x95\xd7\x9f \xd7\x9e\xd7\xaa\xd7\x9e\xd7\xa0\xd7\x94 \xd7\x9c\xd7\xa8\xd7\x95\xd7\x91 \xd7\x92\xd7\x9d \xd7\xa1\xd7\x92\xd7\x9f \xd7\xa9\xd7\xa8.',
                    b'\xd7\xa9\xd7\xa8 \xd7\x94\xd7\x91\xd7\x99\xd7\x98\xd7\x97\xd7\x95\xd7\x9f, <b>\xd7\x94\xd7\x95\xd7\x90 \xd7\x94\xd7\xa9\xd7\xa8 \xd7\x94\xd7\x90\xd7\x97\xd7\xa8\xd7\x90\xd7\x99 \xd7\xa2\xd7\x9c \xd7\x9e\xd7\xa9\xd7\xa8\xd7\x93 \xd7\x96\xd7\x94.</b> \xd7\xaa\xd7\xa4\xd7\xa7\xd7\x99\xd7\x93 \xd7\x96\xd7\x94 <i>\xd7\xa0\xd7\x97\xd7\xa9\xd7\x91 \xd7\x9c\xd7\x90\xd7\x97\xd7\x93</i> \xd7\x94\xd7\xaa\xd7\xa4\xd7\xa7\xd7\x99\xd7\x93\xd7\x99\xd7\x9d <b><i>\xd7\x94\xd7\x91\xd7\x9b\xd7\x99\xd7\xa8\xd7\x99\xd7\x9d \xd7\x91\xd7\x9e\xd7\x9e\xd7\xa9\xd7\x9c\xd7\x94</i></b>. \xd7\x9c\xd7\xa9\xd7\xa8 \xd7\x94\xd7\x91\xd7\x99\xd7\x98\xd7\x97\xd7\x95\xd7\x9f \xd7\x9e\xd7\xaa\xd7\x9e\xd7\xa0\xd7\x94 \xd7\x9c\xd7\xa8\xd7\x95\xd7\x91 \xd7\x92\xd7\x9d \xd7\xa1\xd7\x92\xd7\x9f \xd7\xa9\xd7\xa8.',
                    u'<bullet>\u2022</bullet>\u05e9\u05e8 \u05d4\u05d1\u05d9\u05d8\u05d7\u05d5\u05df, <b>\u05d4\u05d5\u05d0 \u05d4\u05e9\u05e8 \u05d4\u05d0\u05d7\u05e8\u05d0\u05d9 \u05e2\u05dc \u05de\u05e9\u05e8\u05d3 \u05d6\u05d4.</b> \u05ea\u05e4\u05e7\u05d9\u05d3 \u05d6\u05d4 <i>\u05e0\u05d7\u05e9\u05d1 \u05dc\u05d0\u05d7\u05d3</i> \u05d4\u05ea\u05e4\u05e7\u05d9\u05d3\u05d9\u05dd <b><i>\u05d4\u05d1\u05db\u05d9\u05e8\u05d9\u05dd \u05d1\u05de\u05de\u05e9\u05dc\u05d4</i></b>. \u05dc\u05e9\u05e8\u05d4\u05d1\u05d9\u05d8\u05d7\u05d5\u05df \u05de\u05ea\u05de\u05e0\u05d4 \u05dc\u05e8\u05d5\u05d1 \u05d2\u05dd \u05e1\u05d2\u05df \u05e9\u05e8.',
                    ]

            # simple text in a paragraph
            # working with patch from Hosam Aly
            p = Paragraph(TEXTS[0], p_style)
            elements.append(p)

            elements.append(Spacer(0, 40))

            # uses intra paragraph markup -> style text
            p = Paragraph(TEXTS[1], p_style)
            elements.append(p)
            elements.append(Spacer(0, 40))

            # list item (just a paragraph with a leading <bullet> element
            for list_style in list_styles:
                p = Paragraph(TEXTS[2], list_style)
                elements.append(p)

            doc.build(elements)
开发者ID:Distrotech,项目名称:reportlab,代码行数:67,代码来源:test_paragraphs.py

示例9: toParagraphStyle

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

示例10: createPDF

# 需要导入模块: from reportlab.lib.styles import ParagraphStyle [as 别名]
# 或者: from reportlab.lib.styles.ParagraphStyle import rightIndent [as 别名]

#.........这里部分代码省略.........
        styles['Heading4'].leading = 12
        styles['Heading4'].spaceAfter = 6
        styles['Heading4'].textColor = header_rgb
        
        th_cell = ParagraphStyle('TableHeading')
        th_cell.spaceBefore = 3
        th_cell.spaceAfter = 6
        th_cell.fontSize = 10
        th_cell.fontName = 'Times-Bold'

        td_cell = ParagraphStyle('TableData')
        td_cell.spaceBefore = 3
        td_cell.spaceAfter = 6
        td_cell.fontSize = 10
        td_cell.fontName = 'Times-Roman'

        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'
开发者ID:tsimkins,项目名称:agsci.ExtensionExtender,代码行数:70,代码来源:pdf.py


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