ist nichts anders als eine routine OpenOffice documente im QtextBrowser zu zeigen oder auch fuer die html convertierung siehe
http://www.qt-apps.org/content/show.php ... tent=80650
Nun kommen bei mir zweifel auf betrift die CM und millimeter convertierung, Okular hat eine einheit transformations tabelle die alles in 72 DPI transformet...
Somit suche ich die differenz von der wirkliche DPI zu 72 DPI und erhohe oder gehe runter je nach screen aufloesung ...
das reale dokument mit 92 DPI und convertiert im QtextBrowser siehen genau gross aus ... doch wenn ich auf 120 DPI raufgehe habe ich das gefuhl das es etwas zu gross ist oder ist dies eine optische tauschung?
oder was mache ich falsch?
Code: Alles auswählen
/*
default translate units to 72 DPI find difference
faktor to real DPI !
#define INCH_TO_POINT(inch) ((inch)*72.0)
#include <QPixmap>
*/
static inline qreal DPIactualDiff()
{
QPixmap pixmap(50, 80);
pixmap.fill(Qt::transparent);
int hi = qMax(pixmap.logicalDpiY(),72);
int mi = qMin(pixmap.logicalDpiY(),72);
if (hi == mi) {
return 1; /* no difference increase or degrease 1:1 running 72 DPI */
}
const qreal precision = 0.09741; /* gimp precision to image */
////////return 1; /* 1:1 to test */
int diff = hi - mi;
qreal increments = 1.;
if (mi == 72) { ////// more >>>
return increments + (diff / 100.0) + precision;
} else { ///////////// down <<<
return increments - (diff / 100.0) + precision;
}
}
#define PDIFIX(ii) ((ii)*DPIactualDiff())