summaryrefslogtreecommitdiff
path: root/qt/poppler-document.cc
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2006-06-01 17:23:45 +0000
committerAlbert Astals Cid <aacid@kde.org>2006-06-01 17:23:45 +0000
commit2b5d3277f36864ff1ef44f1942f22de247d67ab6 (patch)
tree13549bcfcc243e45ef67ef1c6a38214f8c7417c2 /qt/poppler-document.cc
parent5380d005b7b54cc6587ce6e8c3bbb358da5cd9a5 (diff)
* qt/poppler-document.cc:
* qt/poppler-qt.h: Add printing support, patch by Stefan Kebekus <stefan.kebekus@math.uni-koeln.de>
Diffstat (limited to 'qt/poppler-document.cc')
-rw-r--r--qt/poppler-document.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/qt/poppler-document.cc b/qt/poppler-document.cc
index b53fcc07..1e90e4bc 100644
--- a/qt/poppler-document.cc
+++ b/qt/poppler-document.cc
@@ -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 @@ double Document::getPDFVersion() const
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;
+ }
+}
+
}