Complete Solution

The bug has been removed. However, in PDF format, extra space takes
place where newline character should be. I guess this is because of some
bug in pdfbox APIs.