#๐Ÿ”’ i try to print long text into pdf using reportlab pdfgen, but instead going down, the text going u

5 messages ยท Page 1 of 1 (latest)

austere dune
#

below are the code:

opsum_df = pd.read_excel(dpr_file, sheet_name="Summary")
opsum_text = opsum_df['Description'][0]

styles = getSampleStyleSheet()
normal_style = styles['Normal']
normal_style.fontSize = 5
normal_style.leading = 7
p = Paragraph(opsum_text, normal_style)
p.wrapOn(pdf, 505, 200)
p.drawOn(pdf, 40, 695)

i use sample style sheet, and i wrap the text to limit the length of the text to make newline
but for some reason, the text going upwards instead of downwards

rancid needleBOT
#

@austere dune

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

austere dune
#

i initiate it with

pdf = canvas.Canvas('py.pdf')
pdf.setTitle("Hw-123")
rancid needleBOT
#

@austere dune

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.