PDA

View Full Version : QPrinter, wrong paper size.



Sahab
6th February 2012, 07:54
I try to print using QPrinter (on Brother QL-500)
When I choose paper size in QPrintDialog, template will be printed. But it'll be cut if ticket longer than some size. I set only width of paper, but the height of all tickets is the same. When I try to get size of paper (QSizeF QPrinter::paperSize ( Unit unit ) const), I'll get negative values.
If I set paper size manually (void QPrinter::setPaperSize ( const QSizeF & paperSize, Unit unit )) I'll get a printer error abount wrong paper size. Paper size is the same as in QPrinterDialog.

Can I print on Brother QL-500 using Qt?
Thx

ChrisW67
6th February 2012, 21:12
I try to print using QPrinter (on Brother QL-500)
When I choose paper size in QPrintDialog, template will be printed. But it'll be cut if ticket longer than some size. I set only width of paper, but the height of all tickets is the same. When I try to get size of paper (QSizeF QPrinter::paperSize ( Unit unit ) const), I'll get negative values.

What values? I could perhaps expect a -1, or something similar, for the paper height because the paper is a continuous roll and therefore of indeterminate length. I also expect the printer will have some arbitrary upper limit. I don't have this printer so I can only guess.

If I set paper size manually (void QPrinter::setPaperSize ( const QSizeF & paperSize, Unit unit )) I'll get a printer error abount wrong paper size. Paper size is the same as in QPrinterDialog.
What size? Where do you see this error message? What does printerState() return?


Can I print on Brother QL-500 using Qt?
Probably.

Post an actual small test program that shows what the paperRect() and pageRect() are by default. Also show how you attempt to set it, and what the values are afterward.

Is there a printer-specific mechanism to cause the label roll to be cut?