I have a little code and I would like to wrap my long string in every 10th character and then add it into a PDF using reportlab:
This is how I try:
text = '*long_text_long_text_long_text_long_text*'
text = "\n".join(wrap(text, 10))
canvas.drawString(5,227, text)
My pdf was created but where I want to break the lines I can only see black rectangles. You can see the attached picture:
Can you help me? Thank you!

canvasis, but I bet itsdrawStringmethod does not natively support rendering multiline strings. You'll probably need to manually iterate through each line and draw them individually, specifying the Y-coordinates of each one using your own arithmetic. - Kevin