[poppler] poppler/qt: poppler-document.cc, 1.8, 1.9 poppler-qt.h,
1.15, 1.16
Albert Astals Cid
aacid at kemper.freedesktop.org
Thu Jun 1 10:23:47 PDT 2006
Update of /cvs/poppler/poppler/qt
In directory kemper:/tmp/cvs-serv11876/qt
Modified Files:
poppler-document.cc poppler-qt.h
Log Message:
* qt/poppler-document.cc:
* qt/poppler-qt.h: Add printing support, patch by
Stefan Kebekus <stefan.kebekus at math.uni-koeln.de>
Index: poppler-document.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt/poppler-document.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- poppler-document.cc 20 Mar 2006 20:07:36 -0000 1.8
+++ poppler-document.cc 1 Jun 2006 17:23:45 -0000 1.9
@@ -21,6 +21,7 @@
#include <qimage.h>
#include <GlobalParams.h>
#include <PDFDoc.h>
+#include <PSOutputDev.h>
#include <Catalog.h>
#include <ErrorCodes.h>
#include <SplashOutputDev.h>
@@ -293,4 +294,21 @@
return data->doc.getPDFVersion();
}
+bool Document::print(const QString &file, 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);
+
+ if (psOut->isOk()) {
+ QValueList<int>::iterator it;
+ for (it = pageList.begin(); it != pageList.end(); ++it )
+ data->doc.displayPage(psOut, *it, hDPI, vDPI, rotate, gFalse, globalParams->getPSCrop(), gFalse);
+
+ delete psOut;
+ return true;
+ } else {
+ delete psOut;
+ return false;
+ }
+}
+
}
Index: poppler-qt.h
===================================================================
RCS file: /cvs/poppler/poppler/qt/poppler-qt.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- poppler-qt.h 6 Jan 2006 10:05:59 -0000 1.15
+++ poppler-qt.h 1 Jun 2006 17:23:45 -0000 1.16
@@ -225,6 +225,8 @@
bool okToAddNotes() const;
double getPDFVersion() const;
+ bool print(const QString &fileName, QValueList<int> pageList, double hDPI, double vDPI, int rotate);
+
/**
The fonts within the PDF document.
More information about the poppler
mailing list