سؤال

long_line = '''
xhtml2pdf is a html2pdf converter using the ReportLab Toolkit, the HTML5lib and pyPdf. It supports HTML 5 and CSS 2.1 (and some of CSS 3). It is completely written in pure Python so it is platform independent.
'''
can.drawString(0, 700, long_line) 

The string is too long, so not all of it can show in the pdf page, how to auto-wrap it?

هل كانت مفيدة؟

المحلول

If you want auto wrapping you are probably best off using Platypus or RML with ReportLab. If you draw directly on the canvas you will have to manage string wrapping yourself.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top