I am using QIMAGE class of QT for constructing the image and using the COURIER font .

Printer will support 32 characters for line and i am calculating the IMAGE Height using formula total characters in file/ no of characters per line .

But the problem is it is giving the empty spaces after printing of the file.

Please help me how to resolve the issue.

Thank you.

Ashok

test.txt is the input file.i want all its text to correctly fit on the image.
Below is the piece of code i am using.once you execute this,you will get test2.png file.but this file has some extra spaces.

This looks like an issue with the QT package and your calculations regarding text, font and image sizes. I would guess that you need to spend some time with your debugger, checking that these values are correct.