PDA

View Full Version : QPrinter alignment



alitoh
30th November 2012, 19:46
Hi,

I have a thermal printer in which I need to print a text file receipt-like (not a receipt, but it's an 80mm wide paper-roll).

I want to print a text that's in monospaced font (Courier) and size 10. But the printer has a crazy big margin and I don't know how to change that.

These are screenshots of my issue

This is the text file opened in 3 different applications:
Notepad++, Notepad.exe and Qt QTextEdit. As you can see, the text is being displayed flawlessly
8470

Here is the printing results. As you can see, it is not ok and nothing like the original above.
8471
Each of those were printed in their respective applications. (in Qt's case, with QPrinter)

My first impression is that my biggest concern right now should be the crazy big marigin this has. The margins are almost the same size of the available space for text. However, this is just me trying to make an educated guess and not backed up by formal documentation.

I have no idea how to proceed from here, does anyone know what could be producing this sort of behaviour? It's my first time working with printers and it's already well on it's way to confirm that THIS (http://theoatmeal.com/comics/printers) is true.

Shazy
27th October 2016, 22:35
Can you post the code?