reportlab prints unicode char instead of bullet

530 views Asked by At

On testing the example mentioned in this How can I make the bullet appear directly next to the text of an indented list in the reportlab package for python? question, unicode chars are printed instead of bullets.

Here is my code..

# -*- coding: utf-8 -*-

from reportlab.platypus import Paragraph, ListFlowable, ListItem, SimpleDocTemplate, Frame
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.colors import CMYKColor

doc = SimpleDocTemplate("SOtest.pdf")
styles = getSampleStyleSheet()
Story = []
Story.append(Paragraph("Header Text, I dont want the bullets directly below the H"
                       ,styles['Normal']))
style = styles['Normal']
t = ListFlowable(
        [
        # Paragraph("Item no.1", style),
        ListItem(Paragraph("Item no. 2", style),bulletColor="green",value='circle'),
        ListItem(Paragraph('sublist item 2', style),bulletColor='red',value='circle'),
        ],
        bulletType="bullet",
        start='circle',
        leftIndent=50,
)

Story.append(t)
doc.build(Story)

On the resultant pdf, I got

Header Text, I dont want the bullets directly below the H
\u25cf Item no. 2
\u25cf sublist item 2
0

There are 0 answers