Another (tedious) solution would be to layout your paragraph yourself with textobjects created by canvas.beginText(x, y).
textobject = canvas.beginText(x, y)
textobject.setWordSpace(10)
textobject.textLine("word1 word2")
... (setting other parameters such as font etc.)
canvas.drawText(textobject)
Hope this helps.
0
Benjamin Daniel
On
def pad_text(text, num):
text = str(text)
num = int(num)
text = text[:num]
remaining = num - len(text)
print(remaining)
if (remaining == 0):
return '<div>'+text+'</div>'
else:
res = '<div>'+text+ ' '*remaining +'</div>'
return res
You can use this.
2
Don Guernsey
On
I know I am a little late on this but adding the html for non-breaking space worked for me.
I doubt there is an easy solution for it.
As a workaround you could try adding a blank (transperent or background color) 1px x 1px image in your paragraph and scale it to the desired width.
Another (tedious) solution would be to layout your paragraph yourself with textobjects created by canvas.beginText(x, y).
Hope this helps.