0

I heard that it's impossible to write a paragraph with PDFBox, so simply we can use moveTextPositionByAmount to create each line individually in order to draw our own paragraph.

But my problem is:

It's possible to justify a text by using PDFBox ?

Please i need your help :)

Best regards,

Liszt.

Liszt
  • 157
  • 5
  • 16
  • 1
    Calculate the "natural" length of your line. Count the number of spaces (excluding the last one). Divide the difference of natural vs. justified length by the number of spaces; then this amount needs to be added or subtracted to each space on drawing. – Jongware Aug 25 '13 at 14:51
  • 1
    @Jongware only adding extra width to space characters would look unnatural. I would propose also adding some width to the gap between any two neighboring glyphs, i.e. Not only words spacing but also character spacing use. – mkl Aug 25 '13 at 22:08

0 Answers0