Quote Originally Posted by vermarajeev View Post
double ratio = mappings.dotsPerMm() * MM_PER_IN / PostscriptDPI;
double headerHt;
headerHt = (double)myTextedit->height();
headerHt *= ratio;
Shouldn't it be "headerHt /= ratio;"?

What is the value of "ratio"? Also check whether the resulting width isn't greater than page width.