[poppler] poppler/qt: poppler-document.cc, 1.10, 1.11 poppler-qt.h,
1.19, 1.20
Albert Astals Cid
aacid at kemper.freedesktop.org
Sun Jun 25 09:59:33 PDT 2006
Update of /cvs/poppler/poppler/qt
In directory kemper:/tmp/cvs-serv13421/qt
Modified Files:
poppler-document.cc poppler-qt.h
Log Message:
Ask for paper size width and height to pass it to PSOutputDev in both qt frontends (qt got abi mantained, qt4 changed as you still have to define UNSTABLE_POPPLER_QT4 to be able of using it, one day we'll have to think of removing it)
Index: poppler-document.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt/poppler-document.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- poppler-document.cc 25 Jun 2006 10:29:22 -0000 1.10
+++ poppler-document.cc 25 Jun 2006 16:59:31 -0000 1.11
@@ -293,9 +293,14 @@
return ld;
}
-bool Document::print(const QString &file, QValueList<int> pageList, double hDPI, double vDPI, int rotate)
+bool Document::print(const QString &fileName, QValueList<int> pageList, double hDPI, double vDPI, int rotate)
{
- PSOutputDev *psOut = new PSOutputDev(file.latin1(), data->doc.getXRef(), data->doc.getCatalog(), 1, data->doc.getNumPages(), psModePS);
+ return print(fileName, pageList, hDPI, vDPI, rotate, -1, -1);
+}
+
+bool Document::print(const QString &file, QValueList<int> pageList, double hDPI, double vDPI, int rotate, int paperWidth, int paperHeight)
+{
+ PSOutputDev *psOut = new PSOutputDev(file.latin1(), data->doc.getXRef(), data->doc.getCatalog(), 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight);
if (psOut->isOk()) {
QValueList<int>::iterator it;
Index: poppler-qt.h
===================================================================
RCS file: /cvs/poppler/poppler/qt/poppler-qt.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- poppler-qt.h 25 Jun 2006 16:20:50 -0000 1.19
+++ poppler-qt.h 25 Jun 2006 16:59:31 -0000 1.20
@@ -233,6 +233,15 @@
bool print(const QString &fileName, QValueList<int> pageList, double hDPI, double vDPI, int rotate);
+ // If you are using QPrinter you can get paper size doing
+ // QPrinter dummy(QPrinter::PrinterResolution);
+ // dummy.setFullPage(true);
+ // dummy.setPageSize(thePageSizeYouWant);
+ // QPaintDeviceMetrics metrics(&dummy);
+ // int width = metrics.width();
+ // int height = metrics.height();
+ bool print(const QString &fileName, QValueList<int> pageList, double hDPI, double vDPI, int rotate, int paperWidth, int paperHeight);
+
/**
The fonts within the PDF document.
More information about the poppler
mailing list