<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[SOLVED] PDF Print in multiple pages]]></title><description><![CDATA[<p dir="auto">Hello everyone,<br />
I'm trying to print data from QStringList into a PDF File using the QPrint Class. My function is like :<br />
QString pdfFile = QFileDialog::getSaveFileName(this, tr("Ouvrir fichier"), "/", tr("Fichier pdf (*.pdf)"));</p>
<pre><code>if(pdfFile.isEmpty())
	return;

int nbColonnes = header.size();
int nbDonnees = donnees.size();

QPrinter printer; //The QPrinter class is a paint device that paints on a printer
printer.setOutputFormat(QPrinter::PdfFormat); 
printer.setOrientation(QPrinter::Landscape); 
printer.setPageSize(QPrinter::A4);

//this can be also NativeFormat or PostScriptFormat
//for details, read QPrinter class documentation
printer.setOutputFileName(pdfFile);
QPainter painter; //The QPainter class performs painting on widgets and other paint devices (such as QPrinter)
    
//here we start painting to the printer
if (!painter.begin(&amp;printer))
{
	QMessageBox::critical(this, NAME_APP, "Fichier pdf non crée");
     return;
}

int x = 0;
int y = 0;  

QRect r;
for (int k=0; k&lt;nbColonnes; k++)
{
	// bilog-mh cf. TL-20819 : Paraméterer largeur des colonnes à afficher
	if (k==0)
		colonne_width = 70;
	else if (k==1)
		colonne_width = 130;
	else if (k==2)
		colonne_width = 150;
	else if (k==3)
		colonne_width = 700;

	QRect required = QRect(); //this represent the required rectangled size
	r = QRect(x, 0, colonne_width, 60); //this represent our calculated rectangle size
	painter.drawRect(r);
	//now we insert each string of the list into the rectangle
	QString text = header.at(k);
	//now we draw the text into the given rectangle, using word wrap option.
	//the last parameter indicates a rectangle in which the text should be enclosed         
	painter.drawText(r, Qt::AlignCenter | Qt::TextWordWrap, text, &amp;required);
	//if the calculated height is not enought for drawing the text, we should redraw all rectangles
	 x += colonne_width;			  
}

x = 0;
for (int k=0; k&lt;nbDonnees; k++)
{
	// bilog-mh cf. TL-20819 : Paraméterer largeur des colonnes à afficher
	switch ((k+1)%4)
	{
	case 1 :
			colonne_width = 70;
			break;
	case 2:
			colonne_width = 130;
			break;
	case 3 :
			colonne_width = 150;
			break;
	case 0 :
			colonne_width = 700;
			break;
	}
		
	if (k%nbColonnes == 0)
	{
		// bilog-mh cf. TL-20819 : si première ligne de données alors on retient le height de la ligne header
		if (k== 0)
			y += 60;
		else
			y += 200;
		x = 0;
	}

	QRect required = QRect(); //this represent the required rectangled size
	r = QRect(x, y, colonne_width, 200); //this represent our calculated rectangle size
	painter.drawRect(r);
	//now we insert each string of the list into the rectangle
	QString txt = donnees.at(k);		
	//now we draw the text into the given rectangle, using word wrap option.
	//the last parameter indicates a rectangle in which the text should be enclosed         
	painter.drawText(r, Qt::AlignJustify | Qt::TextWordWrap, txt, &amp;required);

	 x += colonne_width;		 
	 
	// bilog-mh cf. TL-20819 : si on atteint la fin de page, on insère un nouvelle page
	if (y &gt; printer.height())
		printer.newPage();
}
painter.end();
</code></pre>
<p dir="auto">The problem is that only the first page display data and the other pages are blank.</p>
<p dir="auto">Does anyone have an idea what I'm wrong et tell me how to modify my function to display all data ?<br />
Many thanks in advance for your useful help.<br />
Best regards.</p>
]]></description><link>https://forum.qt.io/topic/52652/solved-pdf-print-in-multiple-pages</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 09:34:07 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/52652.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 27 Mar 2015 13:59:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Mon, 05 Feb 2018 07:07:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/filipdns">@<bdi>filipdns</bdi></a> said in <a href="/post/440144">[SOLVED] PDF Print in multiple pages</a>:</p>
<blockquote>
<p dir="auto">QPainter painter(&amp;printer);</p>
</blockquote>
<p dir="auto">Your painter is not a pointer, so change</p>
<pre><code>painter-&gt;drawText(x, y, width, height, Qt::TextExpandTabs , text);
</code></pre>
<p dir="auto">to</p>
<pre><code>painter.drawText(x, y, width, height, Qt::TextExpandTabs , text);
</code></pre>
]]></description><link>https://forum.qt.io/post/440325</link><guid isPermaLink="true">https://forum.qt.io/post/440325</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Mon, 05 Feb 2018 07:07:32 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Sat, 03 Feb 2018 12:43:24 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
Maybe the /t way is too simple.<br />
For a better table look , you can cheat and use HTML</p>
<pre><code>bool createConnection() {
  QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
  db.setDatabaseName(":memory:");
  if (!db.open()) {
    QMessageBox::critical(0, qApp-&gt;tr("Cannot open database"), "Click Cancel to exit.", QMessageBox::Cancel);
    return false;
  }
  QSqlQuery query;
  qDebug() &lt;&lt; "table:" &lt;&lt;   query.exec("create table person (id int primary key, "
                                       "firstname varchar(20), lastname varchar(20), num int )");
  query.exec("insert into person values(101, 'Dennis', 'Young','1')");
  query.exec("insert into person values(102, 'Christine', 'Holand','2')");
  query.exec("insert into person values(103, 'Lars junior', 'Gordon','4')");
  query.exec("insert into person values(104, 'Roberto', 'Robitaille','5')");
  query.exec("insert into person values(105, 'Maria', 'Papadopoulos','3')");
  return true;
}

// credits to. (i adabted from his)  https://stackoverflow.com/questions/3147030/qtableview-printing/4079676#4079676

void PrintTable( QPrinter* printer, QSqlQuery&amp;  Query ) {
  QString strStream;
  QTextStream out(&amp;strStream);

  const int rowCount = Query.size();
  const int columnCount = Query.record().count();

  out &lt;&lt;  "&lt;html&gt;\n"
      "&lt;head&gt;\n"
      "&lt;meta Content=\"Text/html; charset=Windows-1251\"&gt;\n"
      &lt;&lt;  QString("&lt;title&gt;%1&lt;/title&gt;\n").arg("TITLE OF TABLE")
      &lt;&lt;  "&lt;/head&gt;\n"
      "&lt;body bgcolor=#ffffff link=#5000A0&gt;\n"
      "&lt;table border=1 cellspacing=0 cellpadding=2&gt;\n";

  // headers
  out &lt;&lt; "&lt;thead&gt;&lt;tr bgcolor=#f0f0f0&gt;";
  for (int column = 0; column &lt; columnCount; column++)
    out &lt;&lt; QString("&lt;th&gt;%1&lt;/th&gt;").arg(Query.record().fieldName(column));
  out &lt;&lt; "&lt;/tr&gt;&lt;/thead&gt;\n";

  while (Query.next()) {
    out &lt;&lt; "&lt;tr&gt;";
    for (int column = 0; column &lt; columnCount; column++) {
      QString data = Query.value(column).toString();
      out &lt;&lt; QString("&lt;td bkcolor=0&gt;%1&lt;/td&gt;").arg((!data.isEmpty()) ? data : QString("&amp;nbsp;"));
    }
    out &lt;&lt; "&lt;/tr&gt;\n";
  }

  out &lt;&lt;  "&lt;/table&gt;\n"
      "&lt;/body&gt;\n"
      "&lt;/html&gt;\n";

  QTextDocument document;
  document.setHtml(strStream);
  document.print(printer);

}

void print() {
  QPrinter printer(QPrinter::HighResolution);
  printer.setOrientation(QPrinter::Portrait);
  printer.setPageSize(QPrinter::A4);
  printer.setOutputFormat(QPrinter::PdfFormat);
 //  printer.setOutputFileName("e:/file.pdf"); // just for me testing
 QPrintDialog dlg(&amp;printer, 0);
 if(dlg.exec() == QDialog::Accepted) {
  QSqlQuery query;
  query.exec("SELECT * from person");
  PrintTable(&amp;printer, query);
 }
}
...
//To use
// you dont need that just makes my DB createConnection();
  print();
</code></pre>
<p dir="auto">And then you can get this<br />
<img src="http://imagizer.imageshack.com/img923/6981/XvcJtM.png" alt="alt text" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/post/440156</link><guid isPermaLink="true">https://forum.qt.io/post/440156</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sat, 03 Feb 2018 12:43:24 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Sat, 03 Feb 2018 11:14:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/filipdns">@<bdi>filipdns</bdi></a> said in</p>
<blockquote>
<p dir="auto">erreur : C2819: type 'QPainter' does not have an overloaded member 'operator -&gt;'<br />
erreur : C2232: '-&gt;QPainter::drawText': left operand has 'class' type, use '.'<br />
Those are because painter is not pointer so -&gt; should be .<br />
painter-&gt;draw.. should be  painter.drawText</p>
</blockquote>
<blockquote>
<p dir="auto">erreur : C2065: 'x': undeclared identifier<br />
erreur : C2065: 'y': undeclared identifier<br />
erreur : C3861: 'width': identifier not found<br />
erreur : C3861: 'height': identifier not found</p>
</blockquote>
<p dir="auto">You have define them<br />
int x=0;<br />
int y=0;<br />
int width = ? ( whole page for width of table ?)<br />
int height = ? ( whole page for height of table ?)</p>
<p dir="auto">Here comes the the fun part.<br />
For each drawText in the while loop<br />
you must do y+=25; // ( actual line height is better but lets forget for a moment)</p>
<p dir="auto">or it would just draw all text on top on each other so we have to change the y for a new row.</p>
]]></description><link>https://forum.qt.io/post/440145</link><guid isPermaLink="true">https://forum.qt.io/post/440145</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sat, 03 Feb 2018 11:14:15 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Sat, 03 Feb 2018 11:07:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> Hello I try that but I got error :<br />
erreur : C2819: type 'QPainter' does not have an overloaded member 'operator -&gt;'<br />
erreur : C2232: '-&gt;QPainter::drawText': left operand has 'class' type, use '.'<br />
erreur : C2065: 'x': undeclared identifier<br />
erreur : C2065: 'y': undeclared identifier<br />
erreur : C3861: 'width': identifier not found<br />
erreur : C3861: 'height': identifier not found</p>
<pre><code>void print()

{


    QPrinter printer(QPrinter::HighResolution);
    //printer.setResolution(1200);
    printer.setOrientation(QPrinter::Portrait);
    printer.setPageSize(QPrinter::A4);
    QPrintDialog *dlg = new QPrintDialog(&amp;printer,0);
    if(dlg-&gt;exec() == QDialog::Accepted) {
        //QPainter::Antialiasing;
        QPainter::TextAntialiasing;
        QPainter painter(&amp;printer);
        QSqlQuery query;
        query.exec("SELECT date_etape, immatriculation FROM flight_log");
        while (query.next()) {
            QString date_etape = query.value(0).toString();
            QString immatriculation = query.value(1).toString();
            QString text = date_etape +"\t" + immatriculation ; // make one row line with tabs
            painter-&gt;drawText(x, y, width, height, Qt::TextExpandTabs , text); // fix width, height
            //     that would print one "row" tabbed
        }

        painter.end();
    }
</code></pre>
]]></description><link>https://forum.qt.io/post/440144</link><guid isPermaLink="true">https://forum.qt.io/post/440144</guid><dc:creator><![CDATA[filipdns]]></dc:creator><pubDate>Sat, 03 Feb 2018 11:07:17 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Thu, 01 Feb 2018 15:30:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> thank you so much!! I will try that!!</p>
]]></description><link>https://forum.qt.io/post/439769</link><guid isPermaLink="true">https://forum.qt.io/post/439769</guid><dc:creator><![CDATA[filipdns]]></dc:creator><pubDate>Thu, 01 Feb 2018 15:30:08 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Thu, 01 Feb 2018 15:31:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/filipdns">@<bdi>filipdns</bdi></a><br />
Well to get result, it would be using<br />
<a href="http://doc.qt.io/qt-5/sql-sqlstatements.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/sql-sqlstatements.html</a></p>
<pre><code>(in paintEvent/print)
  QPainter painter(printer);  
  QSqlQuery query;
  query.exec("SELECT name, salary FROM employee WHERE salary &gt; 50000");
    while (query.next()) {
        QString name = query.value(0).toString();
        int salary = query.value(1).toInt();
       QString text = name +"\t" + salary ; // make one row line with tabs
       painter-&gt;drawText(x, y, width, height, Qt::TextExpandTabs , text); // fix width, height 
//     that would print one "row" tabbed
    }
</code></pre>
<p dir="auto">All names for tables etc are ofc wrong here. Must use your real names.</p>
]]></description><link>https://forum.qt.io/post/439762</link><guid isPermaLink="true">https://forum.qt.io/post/439762</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Thu, 01 Feb 2018 15:31:51 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Thu, 01 Feb 2018 14:44:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> oki, thanks I will try that.</p>
<p dir="auto">Do you have code sample to get result like you show before from SQLite table?</p>
]]></description><link>https://forum.qt.io/post/439755</link><guid isPermaLink="true">https://forum.qt.io/post/439755</guid><dc:creator><![CDATA[filipdns]]></dc:creator><pubDate>Thu, 01 Feb 2018 14:44:53 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Thu, 01 Feb 2018 10:44:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/filipdns">@<bdi>filipdns</bdi></a><br />
Hi<br />
well to add logo, you just draw an image<br />
with drawPixmap where you want.</p>
]]></description><link>https://forum.qt.io/post/439709</link><guid isPermaLink="true">https://forum.qt.io/post/439709</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Thu, 01 Feb 2018 10:44:50 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Thu, 01 Feb 2018 10:38:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> I would like add logo but your example is good point to start</p>
]]></description><link>https://forum.qt.io/post/439708</link><guid isPermaLink="true">https://forum.qt.io/post/439708</guid><dc:creator><![CDATA[filipdns]]></dc:creator><pubDate>Thu, 01 Feb 2018 10:38:24 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Thu, 01 Feb 2018 09:23:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/filipdns">@<bdi>filipdns</bdi></a></p>
<p dir="auto">Im wondering how you want the table to look ?</p>
<p dir="auto">With captions and cells lines and all the bells?<br />
or would something like</p>
<pre><code>Name        Age  Phone
-----------------------------
Mister Muh  12   0014545454545
Miss Miaow  12   0045454
Dude        66   66-66-66-66
</code></pre>
<p dir="auto">Be enough ?</p>
<p dir="auto">(made with tabs)</p>
]]></description><link>https://forum.qt.io/post/439677</link><guid isPermaLink="true">https://forum.qt.io/post/439677</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Thu, 01 Feb 2018 09:23:17 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Thu, 01 Feb 2018 07:16:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> I understand, thank you</p>
]]></description><link>https://forum.qt.io/post/439652</link><guid isPermaLink="true">https://forum.qt.io/post/439652</guid><dc:creator><![CDATA[filipdns]]></dc:creator><pubDate>Thu, 01 Feb 2018 07:16:53 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Thu, 01 Feb 2018 07:15:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/filipdns">@<bdi>filipdns</bdi></a></p>
<p dir="auto">Hi<br />
I have not seen any samples that uses text. most print an image.</p>
]]></description><link>https://forum.qt.io/post/439650</link><guid isPermaLink="true">https://forum.qt.io/post/439650</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Thu, 01 Feb 2018 07:15:31 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Thu, 01 Feb 2018 07:10:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> just in case I can not found how to use the report generator, do you have a small sample code with qsqldatabase + QSqlQuery and use painter.drawText to paint a table?<br />
thank you very much</p>
]]></description><link>https://forum.qt.io/post/439648</link><guid isPermaLink="true">https://forum.qt.io/post/439648</guid><dc:creator><![CDATA[filipdns]]></dc:creator><pubDate>Thu, 01 Feb 2018 07:10:44 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Thu, 01 Feb 2018 07:08:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a>  Thanks a lot for your reply, the report generator look very nice but I don't understand yet how to include this to my project to make automatic report by click button, I have to study again the readme ;-)</p>
]]></description><link>https://forum.qt.io/post/439647</link><guid isPermaLink="true">https://forum.qt.io/post/439647</guid><dc:creator><![CDATA[filipdns]]></dc:creator><pubDate>Thu, 01 Feb 2018 07:08:06 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Tue, 30 Jan 2018 16:36:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/filipdns">@<bdi>filipdns</bdi></a><br />
Hi<br />
To print data from a db, you use<br />
qsqldatabase + QSqlQuery and use<br />
painter.drawText to paint a table.</p>
<p dir="auto">You can also use   QTableView + QSqlTableModel and print an image of the<br />
QTableView to get cell painting etc.</p>
<p dir="auto">Alternatively you can use a report generator like<br />
<a href="https://sourceforge.net/projects/qtrpt/" target="_blank" rel="noopener noreferrer nofollow ugc">https://sourceforge.net/projects/qtrpt/</a></p>
]]></description><link>https://forum.qt.io/post/439347</link><guid isPermaLink="true">https://forum.qt.io/post/439347</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Tue, 30 Jan 2018 16:36:18 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Tue, 30 Jan 2018 13:38:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mourad_bilog">@<bdi>mourad_bilog</bdi></a><br />
Hello Mourad, I'm trying to print pdf in multiple page also but with table creation with data from SQLite, did you do that already? do you have sample code for that?</p>
<p dir="auto">Best regards<br />
Philippe</p>
]]></description><link>https://forum.qt.io/post/439320</link><guid isPermaLink="true">https://forum.qt.io/post/439320</guid><dc:creator><![CDATA[filipdns]]></dc:creator><pubDate>Tue, 30 Jan 2018 13:38:29 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Fri, 27 Mar 2015 15:01:34 GMT]]></title><description><![CDATA[<p dir="auto">Ok,</p>
<p dir="auto">don't forget to mark the thread as solved (add <strong>[SOLVED]</strong> prefix to the thread title)</p>
]]></description><link>https://forum.qt.io/post/267302</link><guid isPermaLink="true">https://forum.qt.io/post/267302</guid><dc:creator><![CDATA[mcosta]]></dc:creator><pubDate>Fri, 27 Mar 2015 15:01:34 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Fri, 27 Mar 2015 14:54:49 GMT]]></title><description><![CDATA[<p dir="auto">Ohhhh yeees.<br />
It's Ok :)<br />
Many thanks for your help</p>
]]></description><link>https://forum.qt.io/post/267301</link><guid isPermaLink="true">https://forum.qt.io/post/267301</guid><dc:creator><![CDATA[mourad_bilog]]></dc:creator><pubDate>Fri, 27 Mar 2015 14:54:49 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Fri, 27 Mar 2015 14:43:46 GMT]]></title><description><![CDATA[<p dir="auto">I'm not 100% sure but could you reset <code>y=0</code> when you start a new page??</p>
]]></description><link>https://forum.qt.io/post/267299</link><guid isPermaLink="true">https://forum.qt.io/post/267299</guid><dc:creator><![CDATA[mcosta]]></dc:creator><pubDate>Fri, 27 Mar 2015 14:43:46 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Fri, 27 Mar 2015 14:39:07 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for reply.</p>
<p dir="auto">I've verified it and the printer.newPage(); is executed. In fact, the output file have 77 pages but only the first page contains data and the others are all blank.</p>
]]></description><link>https://forum.qt.io/post/267297</link><guid isPermaLink="true">https://forum.qt.io/post/267297</guid><dc:creator><![CDATA[mourad_bilog]]></dc:creator><pubDate>Fri, 27 Mar 2015 14:39:07 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] PDF Print in multiple pages on Fri, 27 Mar 2015 14:27:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mourad_bilog">@<bdi>mourad_bilog</bdi></a> said:</p>
<blockquote>
<p dir="auto">The problem is that only the first page display data and the other pages are blank.</p>
</blockquote>
<p dir="auto">Is the first page printed correctly??</p>
<p dir="auto">Could you add a <code>qDebug()</code> line inside this statement to be sure is executed??</p>
<pre><code>if (y &gt; printer.height())
    printer.newPage();
</code></pre>
<p dir="auto">like</p>
<pre><code>if (y &gt; printer.height()) {
    qDebug() &lt;&lt; "New Page";
    printer.newPage();
}
</code></pre>
]]></description><link>https://forum.qt.io/post/267291</link><guid isPermaLink="true">https://forum.qt.io/post/267291</guid><dc:creator><![CDATA[mcosta]]></dc:creator><pubDate>Fri, 27 Mar 2015 14:27:55 GMT</pubDate></item></channel></rss>