The resolutions from the scaling used today with the 213MB document were as follows:
Printer: 4908, 6408 QTextEdit widget: 750, 500
scalex: 6.544, scaley: 12.816, scale: 6.544
There were no debug messages and no error messages and the file size was the same using the printer locally or over the network. Everything seems to point to the extreme document size being the only issue.
Am I somehow introducing the issue into my code?
Is there an easy way to force a smaller print document format?
Could it be anything to do with the font code? (I feel like I'm clutching at straws here)
RECAP OF MAIN CODE
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
void MainWindow::menuPrintTest(){
double xscale; double yscale; double scale; double printerWidth ; double printerHeight ; double widgetWidth; double widgetHeight ;
QFont printFont("courier", 16);
printFont.setFixedPitch(TRUE);
QTextEdit *qteTestPrintRequest = new QTextEdit("",w);
qteTestPrintRequest ->setFont(printFont );
qteTestPrintRequest ->setFixedHeight(500);
qteTestPrintRequest ->setFixedWidth(750);
widgetWidth = qteTestPrintRequest ->width() ;
widgetHeight = qteTestPrintRequest ->height() ;
QString qsConcat = "Test Printout For Checking XP Print Request Bug\n";
for (int i=0; i<30; i++){ qsConcat+= "Test Printout for Checking XP Print Request Bug\n" ; }
qteTestPrintRequest->append( qsConcat );
QPrinter printer(QPrinter::HighResolution);
QString docName = "Test Plot";
if ( !docName.isEmpty()) {
docName.replace (QRegExp (QString::fromLatin1 ("\n")), tr (" -- "));
printer.setDocName (docName);
}
QPrintDialog dialog(&printer);
if ( dialog.exec() ) {
QPainter painter(&printer);
{
printerWidth = printer.pageRect().width();
printerHeight = printer.pageRect().height();
xscale = printerWidth/(widgetWidth);
yscale = printerHeight/(widgetHeight);
scale = qMin(xscale, yscale);
painter.scale(scale, scale);
qteTestPrintRequest ->render(&painter);
} //QPAINTER CTOR BRACE
}else{}
delete qteTestPrintRequest;
}
|