PDA

View Full Version : QPrinter



fpujol
25th January 2007, 16:50
Hello,

Now I'm creating a ticket for my supermaket application, so I need to print. My objective is to setFullPage to print in (0,0) coordinate, but this don't have effect always there's 3 or 4 white lines. And in the next code I put QPrinter::A4 but when it shows me the dialog always there's letter format.

QTextDocument *document = qTextEdit->document();
QPrinter printer;

printer.setFullPage(TRUE);
printer.setPageSize(QPrinter::A4);
QPrintDialog *dialog = new QPrintDialog(&printer, this);

dialog->setWindowTitle(tr("Print Document from aklibs"));
if (dialog->exec() != QDialog::Accepted)
return;

document->print(&printer);

Thank you.

e8johan
26th January 2007, 08:11
Could it be that the print dialog picks the paper size information from the current printer?

fpujol
26th January 2007, 10:26
Yes do it, but why don't take my params. Only I can change the number of copies, and don't take my paper size that I put in QPrinter, and the most important I can't print in coordinates (0,0).

I no surrender....

fpujol
26th January 2007, 12:01
I see the changes putting setFullPage(FALSE) or setFullPage(TRUE) , but don't start printing on (0,0)