Commit 9caf7525 authored by Albert Astals Cid's avatar Albert Astals Cid

Make PSOutputDev accept a list of pages indeces

Instead of first, last

Bug #84833

Reviewed in the mailing list, see "Can anyone have a look at my patch?"
parent 173f182f
...@@ -1110,14 +1110,18 @@ poppler_page_render_to_ps (PopplerPage *page, ...@@ -1110,14 +1110,18 @@ poppler_page_render_to_ps (PopplerPage *page,
g_return_if_fail (POPPLER_IS_PAGE (page)); g_return_if_fail (POPPLER_IS_PAGE (page));
g_return_if_fail (ps_file != NULL); g_return_if_fail (ps_file != NULL);
if (!ps_file->out) if (!ps_file->out) {
std::vector<int> pages;
for (int i = ps_file->first_page; i <= ps_file->last_page; ++i) {
pages.push_back(i);
}
ps_file->out = new PSOutputDev (ps_file->filename, ps_file->out = new PSOutputDev (ps_file->filename,
ps_file->document->doc, ps_file->document->doc,
NULL, NULL, pages,
ps_file->first_page, ps_file->last_page,
psModePS, (int)ps_file->paper_width, psModePS, (int)ps_file->paper_width,
(int)ps_file->paper_height, ps_file->duplex, (int)ps_file->paper_height, ps_file->duplex,
0, 0, 0, 0, gFalse, gFalse); 0, 0, 0, 0, gFalse, gFalse);
}
ps_file->document->doc->displayPage (ps_file->out, page->index + 1, 72.0, 72.0, ps_file->document->doc->displayPage (ps_file->out, page->index + 1, 72.0, 72.0,
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
// //
// Copyright (C) 2005 Martin Kretzschmar <martink@gnome.org> // Copyright (C) 2005 Martin Kretzschmar <martink@gnome.org>
// Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2006-2009, 2011-2013 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2006-2009, 2011-2013, 2015 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2006 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2006 Jeff Muizelaar <jeff@infidigm.net>
// Copyright (C) 2007, 2008 Brad Hards <bradh@kde.org> // Copyright (C) 2007, 2008 Brad Hards <bradh@kde.org>
// Copyright (C) 2008, 2009 Koji Otani <sho@bbr.jp> // Copyright (C) 2008, 2009 Koji Otani <sho@bbr.jp>
...@@ -1074,7 +1074,7 @@ static void outputToFile(void *stream, const char *data, int len) { ...@@ -1074,7 +1074,7 @@ static void outputToFile(void *stream, const char *data, int len) {
PSOutputDev::PSOutputDev(const char *fileName, PDFDoc *doc, PSOutputDev::PSOutputDev(const char *fileName, PDFDoc *doc,
char *psTitle, char *psTitle,
int firstPage, int lastPage, PSOutMode modeA, const std::vector<int> &pages, PSOutMode modeA,
int paperWidthA, int paperHeightA, int paperWidthA, int paperHeightA,
GBool noCropA, GBool duplexA, GBool noCropA, GBool duplexA,
int imgLLXA, int imgLLYA, int imgURXA, int imgURYA, int imgLLXA, int imgLLYA, int imgURXA, int imgURYA,
...@@ -1136,7 +1136,7 @@ PSOutputDev::PSOutputDev(const char *fileName, PDFDoc *doc, ...@@ -1136,7 +1136,7 @@ PSOutputDev::PSOutputDev(const char *fileName, PDFDoc *doc,
} }
init(outputToFile, f, fileTypeA, psTitle, init(outputToFile, f, fileTypeA, psTitle,
doc, firstPage, lastPage, modeA, doc, pages, modeA,
imgLLXA, imgLLYA, imgURXA, imgURYA, manualCtrlA, imgLLXA, imgLLYA, imgURXA, imgURYA, manualCtrlA,
paperWidthA, paperHeightA, noCropA, duplexA); paperWidthA, paperHeightA, noCropA, duplexA);
} }
...@@ -1144,7 +1144,7 @@ PSOutputDev::PSOutputDev(const char *fileName, PDFDoc *doc, ...@@ -1144,7 +1144,7 @@ PSOutputDev::PSOutputDev(const char *fileName, PDFDoc *doc,
PSOutputDev::PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA, PSOutputDev::PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA,
char *psTitle, char *psTitle,
PDFDoc *doc, PDFDoc *doc,
int firstPage, int lastPage, PSOutMode modeA, const std::vector<int> &pages, PSOutMode modeA,
int paperWidthA, int paperHeightA, int paperWidthA, int paperHeightA,
GBool noCropA, GBool duplexA, GBool noCropA, GBool duplexA,
int imgLLXA, int imgLLYA, int imgURXA, int imgURYA, int imgLLXA, int imgLLYA, int imgURXA, int imgURYA,
...@@ -1174,7 +1174,7 @@ PSOutputDev::PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA, ...@@ -1174,7 +1174,7 @@ PSOutputDev::PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA,
forceRasterize = forceRasterizeA; forceRasterize = forceRasterizeA;
init(outputFuncA, outputStreamA, psGeneric, psTitle, init(outputFuncA, outputStreamA, psGeneric, psTitle,
doc, firstPage, lastPage, modeA, doc, pages, modeA,
imgLLXA, imgLLYA, imgURXA, imgURYA, manualCtrlA, imgLLXA, imgLLYA, imgURXA, imgURYA, manualCtrlA,
paperWidthA, paperHeightA, noCropA, duplexA); paperWidthA, paperHeightA, noCropA, duplexA);
} }
...@@ -1214,7 +1214,7 @@ static bool pageDimensionEqual(int a, int b) { ...@@ -1214,7 +1214,7 @@ static bool pageDimensionEqual(int a, int b) {
void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA, void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA,
PSFileType fileTypeA, char *pstitle, PDFDoc *docA, PSFileType fileTypeA, char *pstitle, PDFDoc *docA,
int firstPage, int lastPage, PSOutMode modeA, const std::vector<int> &pagesA, PSOutMode modeA,
int imgLLXA, int imgLLYA, int imgURXA, int imgURYA, int imgLLXA, int imgLLYA, int imgURXA, int imgURYA,
GBool manualCtrlA, int paperWidthA, int paperHeightA, GBool manualCtrlA, int paperWidthA, int paperHeightA,
GBool noCropA, GBool duplexA) { GBool noCropA, GBool duplexA) {
...@@ -1222,7 +1222,12 @@ void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA, ...@@ -1222,7 +1222,12 @@ void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA,
PDFRectangle *box; PDFRectangle *box;
PSOutPaperSize *size; PSOutPaperSize *size;
GooList *names; GooList *names;
int pg, w, h, i; int w, h, i;
if (pagesA.empty()) {
ok = gFalse;
return;
}
// initialize // initialize
displayText = gTrue; displayText = gTrue;
...@@ -1249,9 +1254,8 @@ void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA, ...@@ -1249,9 +1254,8 @@ void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA,
} }
Page *page; Page *page;
paperSizes = new GooList(); paperSizes = new GooList();
for (pg = (firstPage >= 1) ? firstPage : 1; for (size_t pgi = 0; pgi < pagesA.size(); ++pgi) {
pg <= lastPage && pg <= catalog->getNumPages(); const int pg = pagesA[pgi];
++pg) {
page = catalog->getPage(pg); page = catalog->getPage(pg);
if (page == NULL) if (page == NULL)
paperMatch = gFalse; paperMatch = gFalse;
...@@ -1313,8 +1317,11 @@ void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA, ...@@ -1313,8 +1317,11 @@ void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA,
imgURY = paperHeight; imgURY = paperHeight;
} }
manualCtrl = manualCtrlA; manualCtrl = manualCtrlA;
std::vector<int> pages;
if (mode == psModeForm) { if (mode == psModeForm) {
lastPage = firstPage; pages.push_back(pagesA[0]);
} else {
pages = pagesA;
} }
processColors = 0; processColors = 0;
inType3Char = gFalse; inType3Char = gFalse;
...@@ -1367,16 +1374,16 @@ void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA, ...@@ -1367,16 +1374,16 @@ void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA,
if (!manualCtrl) { if (!manualCtrl) {
Page *page; Page *page;
// this check is needed in case the document has zero pages // this check is needed in case the document has zero pages
if ((page = doc->getPage(firstPage))) { if ((page = doc->getPage(pages[0]))) {
writeHeader(firstPage, lastPage, writeHeader(pages,
page->getMediaBox(), page->getMediaBox(),
page->getCropBox(), page->getCropBox(),
page->getRotate(), page->getRotate(),
pstitle); pstitle);
} else { } else {
error(errSyntaxError, -1, "Invalid page {0:d}", firstPage); error(errSyntaxError, -1, "Invalid page {0:d}", pages[0]);
box = new PDFRectangle(0, 0, 1, 1); box = new PDFRectangle(0, 0, 1, 1);
writeHeader(firstPage, lastPage, box, box, 0, pstitle); writeHeader(pages, box, box, 0, pstitle);
delete box; delete box;
} }
if (mode != psModeForm) { if (mode != psModeForm) {
...@@ -1387,7 +1394,7 @@ void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA, ...@@ -1387,7 +1394,7 @@ void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA,
writePS("%%EndProlog\n"); writePS("%%EndProlog\n");
writePS("%%BeginSetup\n"); writePS("%%BeginSetup\n");
} }
writeDocSetup(doc, catalog, firstPage, lastPage, duplexA); writeDocSetup(doc, catalog, pages, duplexA);
if (mode != psModeForm) { if (mode != psModeForm) {
writePS("%%EndSetup\n"); writePS("%%EndSetup\n");
} }
...@@ -1463,7 +1470,7 @@ PSOutputDev::~PSOutputDev() { ...@@ -1463,7 +1470,7 @@ PSOutputDev::~PSOutputDev() {
} }
} }
void PSOutputDev::writeHeader(int firstPage, int lastPage, void PSOutputDev::writeHeader(const std::vector<int> &pages,
PDFRectangle *mediaBox, PDFRectangle *cropBox, PDFRectangle *mediaBox, PDFRectangle *cropBox,
int pageRotate, char *psTitle) { int pageRotate, char *psTitle) {
Object info, obj1; Object info, obj1;
...@@ -1520,7 +1527,7 @@ void PSOutputDev::writeHeader(int firstPage, int lastPage, ...@@ -1520,7 +1527,7 @@ void PSOutputDev::writeHeader(int firstPage, int lastPage,
i==0 ? "DocumentMedia:" : "+", size->name, size->w, size->h); i==0 ? "DocumentMedia:" : "+", size->name, size->w, size->h);
} }
writePSFmt("%%BoundingBox: 0 0 {0:d} {1:d}\n", paperWidth, paperHeight); writePSFmt("%%BoundingBox: 0 0 {0:d} {1:d}\n", paperWidth, paperHeight);
writePSFmt("%%Pages: {0:d}\n", lastPage - firstPage + 1); writePSFmt("%%Pages: {0:d}\n", static_cast<int>(pages.size()));
writePS("%%EndComments\n"); writePS("%%EndComments\n");
if (!paperMatch) { if (!paperMatch) {
size = (PSOutPaperSize *)paperSizes->get(0); size = (PSOutPaperSize *)paperSizes->get(0);
...@@ -1603,7 +1610,7 @@ void PSOutputDev::writeXpdfProcset() { ...@@ -1603,7 +1610,7 @@ void PSOutputDev::writeXpdfProcset() {
} }
void PSOutputDev::writeDocSetup(PDFDoc *doc, Catalog *catalog, void PSOutputDev::writeDocSetup(PDFDoc *doc, Catalog *catalog,
int firstPage, int lastPage, const std::vector<int> &pages,
GBool duplexA) { GBool duplexA) {
Page *page; Page *page;
Dict *resDict; Dict *resDict;
...@@ -1611,7 +1618,7 @@ void PSOutputDev::writeDocSetup(PDFDoc *doc, Catalog *catalog, ...@@ -1611,7 +1618,7 @@ void PSOutputDev::writeDocSetup(PDFDoc *doc, Catalog *catalog,
Object *acroForm; Object *acroForm;
Object obj1, obj2, obj3; Object obj1, obj2, obj3;
GooString *s; GooString *s;
int pg, i; int i;
if (mode == psModeForm) { if (mode == psModeForm) {
// swap the form and xpdf dicts // swap the form and xpdf dicts
...@@ -1619,7 +1626,8 @@ void PSOutputDev::writeDocSetup(PDFDoc *doc, Catalog *catalog, ...@@ -1619,7 +1626,8 @@ void PSOutputDev::writeDocSetup(PDFDoc *doc, Catalog *catalog,
} else { } else {
writePS("xpdf begin\n"); writePS("xpdf begin\n");
} }
for (pg = firstPage; pg <= lastPage; ++pg) { for (size_t pgi = 0; pgi < pages.size(); ++pgi) {
const int pg = pages[pgi];
page = doc->getPage(pg); page = doc->getPage(pg);
if (!page) { if (!page) {
error(errSyntaxError, -1, "Failed writing resources for page {0:d}", pg); error(errSyntaxError, -1, "Failed writing resources for page {0:d}", pg);
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
// //
// Copyright (C) 2005 Martin Kretzschmar <martink@gnome.org> // Copyright (C) 2005 Martin Kretzschmar <martink@gnome.org>
// Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com> // Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2006-2008, 2012, 2013 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2006-2008, 2012, 2013, 2015 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2007 Brad Hards <bradh@kde.org> // Copyright (C) 2007 Brad Hards <bradh@kde.org>
// Copyright (C) 2009-2013 Thomas Freitag <Thomas.Freitag@alfa.de> // Copyright (C) 2009-2013 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2009 Till Kamppeter <till.kamppeter@gmail.com> // Copyright (C) 2009 Till Kamppeter <till.kamppeter@gmail.com>
...@@ -93,9 +93,10 @@ class PSOutputDev: public OutputDev { ...@@ -93,9 +93,10 @@ class PSOutputDev: public OutputDev {
public: public:
// Open a PostScript output file, and write the prolog. // Open a PostScript output file, and write the prolog.
// pages has to be sorted in increasing order
PSOutputDev(const char *fileName, PDFDoc *docA, PSOutputDev(const char *fileName, PDFDoc *docA,
char *psTitle, char *psTitle,
int firstPage, int lastPage, PSOutMode modeA, const std::vector<int> &pages, PSOutMode modeA,
int paperWidthA = -1, int paperHeightA = -1, int paperWidthA = -1, int paperHeightA = -1,
GBool noCrop = gFalse, GBool noCrop = gFalse,
GBool duplexA = gTrue, GBool duplexA = gTrue,
...@@ -107,10 +108,11 @@ public: ...@@ -107,10 +108,11 @@ public:
void *customCodeCbkDataA = NULL); void *customCodeCbkDataA = NULL);
// Open a PSOutputDev that will write to a generic stream. // Open a PSOutputDev that will write to a generic stream.
// pages has to be sorted in increasing order
PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA, PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA,
char *psTitle, char *psTitle,
PDFDoc *docA, PDFDoc *docA,
int firstPage, int lastPage, PSOutMode modeA, const std::vector<int> &pages, PSOutMode modeA,
int paperWidthA = -1, int paperHeightA = -1, int paperWidthA = -1, int paperHeightA = -1,
GBool noCrop = gFalse, GBool noCrop = gFalse,
GBool duplexA = gTrue, GBool duplexA = gTrue,
...@@ -160,7 +162,7 @@ public: ...@@ -160,7 +162,7 @@ public:
//----- header/trailer (used only if manualCtrl is true) //----- header/trailer (used only if manualCtrl is true)
// Write the document-level header. // Write the document-level header.
void writeHeader(int firstPage, int lastPage, void writeHeader(const std::vector<int> &pages,
PDFRectangle *mediaBox, PDFRectangle *cropBox, PDFRectangle *mediaBox, PDFRectangle *cropBox,
int pageRotate, char *pstitle); int pageRotate, char *pstitle);
...@@ -310,7 +312,7 @@ private: ...@@ -310,7 +312,7 @@ private:
void init(PSOutputFunc outputFuncA, void *outputStreamA, void init(PSOutputFunc outputFuncA, void *outputStreamA,
PSFileType fileTypeA, char *pstitle, PDFDoc *doc, PSFileType fileTypeA, char *pstitle, PDFDoc *doc,
int firstPage, int lastPage, PSOutMode modeA, const std::vector<int> &pages, PSOutMode modeA,
int imgLLXA, int imgLLYA, int imgURXA, int imgURYA, int imgLLXA, int imgLLYA, int imgURXA, int imgURYA,
GBool manualCtrlA, int paperWidthA, int paperHeightA, GBool manualCtrlA, int paperWidthA, int paperHeightA,
GBool noCropA, GBool duplexA); GBool noCropA, GBool duplexA);
...@@ -386,7 +388,7 @@ private: ...@@ -386,7 +388,7 @@ private:
GooString *filterPSName(GooString *name); GooString *filterPSName(GooString *name);
// Write the document-level setup. // Write the document-level setup.
void writeDocSetup(PDFDoc *doc, Catalog *catalog, int firstPage, int lastPage, GBool duplexA); void writeDocSetup(PDFDoc *doc, Catalog *catalog, const std::vector<int> &pages, GBool duplexA);
void writePSChar(char c); void writePSChar(char c);
void writePS(const char *s); void writePS(const char *s);
......
/* poppler-ps-converter.cc: qt interface to poppler /* poppler-ps-converter.cc: qt interface to poppler
* Copyright (C) 2007, 2009, 2010, Albert Astals Cid <aacid@kde.org> * Copyright (C) 2007, 2009, 2010, 2015, Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2008, Pino Toscano <pino@kde.org> * Copyright (C) 2008, Pino Toscano <pino@kde.org>
* Copyright (C) 2010 Hib Eris <hib@hiberis.nl> * Copyright (C) 2010 Hib Eris <hib@hiberis.nl>
* Copyright (C) 2011 Glad Deschrijver <glad.deschrijver@gmail.com> * Copyright (C) 2011 Glad Deschrijver <glad.deschrijver@gmail.com>
...@@ -216,11 +216,16 @@ bool PSConverter::convert() ...@@ -216,11 +216,16 @@ bool PSConverter::convert()
if (!d->title.isEmpty()) pstitlechar = pstitle8Bit.data(); if (!d->title.isEmpty()) pstitlechar = pstitle8Bit.data();
else pstitlechar = 0; else pstitlechar = 0;
std::vector<int> pages;
foreach(int page, d->pageList)
{
pages.push_back(page);
}
PSOutputDev *psOut = new PSOutputDev(outputToQIODevice, dev, PSOutputDev *psOut = new PSOutputDev(outputToQIODevice, dev,
pstitlechar, pstitlechar,
d->document->doc, d->document->doc,
1, pages,
d->document->doc->getNumPages(),
(d->opts & PrintToEPS) ? psModeEPS : psModePS, (d->opts & PrintToEPS) ? psModeEPS : psModePS,
d->paperWidth, d->paperWidth,
d->paperHeight, d->paperHeight,
......
/* poppler-ps-converter.cc: qt interface to poppler /* poppler-ps-converter.cc: qt interface to poppler
* Copyright (C) 2007, 2009, 2010, Albert Astals Cid <aacid@kde.org> * Copyright (C) 2007, 2009, 2010, 2015, Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2008, Pino Toscano <pino@kde.org> * Copyright (C) 2008, Pino Toscano <pino@kde.org>
* Copyright (C) 2010 Hib Eris <hib@hiberis.nl> * Copyright (C) 2010 Hib Eris <hib@hiberis.nl>
* Copyright (C) 2011 Glad Deschrijver <glad.deschrijver@gmail.com> * Copyright (C) 2011 Glad Deschrijver <glad.deschrijver@gmail.com>
...@@ -216,11 +216,16 @@ bool PSConverter::convert() ...@@ -216,11 +216,16 @@ bool PSConverter::convert()
if (!d->title.isEmpty()) pstitlechar = pstitle8Bit.data(); if (!d->title.isEmpty()) pstitlechar = pstitle8Bit.data();
else pstitlechar = 0; else pstitlechar = 0;
std::vector<int> pages;
foreach(int page, d->pageList)
{
pages.push_back(page);
}
PSOutputDev *psOut = new PSOutputDev(outputToQIODevice, dev, PSOutputDev *psOut = new PSOutputDev(outputToQIODevice, dev,
pstitlechar, pstitlechar,
d->document->doc, d->document->doc,
1, pages,
d->document->doc->getNumPages(),
(d->opts & PrintToEPS) ? psModeEPS : psModePS, (d->opts & PrintToEPS) ? psModeEPS : psModePS,
d->paperWidth, d->paperWidth,
d->paperHeight, d->paperHeight,
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
// under GPL version 2 or later // under GPL version 2 or later
// //
// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com> // Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2007-2008, 2010 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2007-2008, 2010, 2015 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009 Till Kamppeter <till.kamppeter@gmail.com> // Copyright (C) 2009 Till Kamppeter <till.kamppeter@gmail.com>
// Copyright (C) 2009 Sanjoy Mahajan <sanjoy@mit.edu> // Copyright (C) 2009 Sanjoy Mahajan <sanjoy@mit.edu>
// Copyright (C) 2009, 2011, 2012 William Bader <williambader@hotmail.com> // Copyright (C) 2009, 2011, 2012 William Bader <williambader@hotmail.com>
...@@ -206,6 +206,7 @@ int main(int argc, char *argv[]) { ...@@ -206,6 +206,7 @@ int main(int argc, char *argv[]) {
GBool ok; GBool ok;
char *p; char *p;
int exitCode; int exitCode;
std::vector<int> pages;
exitCode = 99; exitCode = 99;
...@@ -400,16 +401,22 @@ int main(int argc, char *argv[]) { ...@@ -400,16 +401,22 @@ int main(int argc, char *argv[]) {
goto err2; goto err2;
} }
for (int i = firstPage; i <= lastPage; ++i) {
pages.push_back(i);
}
// write PostScript file // write PostScript file
psOut = new PSOutputDev(psFileName->getCString(), doc, psOut = new PSOutputDev(psFileName->getCString(), doc,
NULL, firstPage, lastPage, mode, NULL, pages, mode,
paperWidth, paperWidth,
paperHeight, paperHeight,
noCrop, noCrop,
duplex); duplex);
if (psOut->isOk()) { if (psOut->isOk()) {
doc->displayPages(psOut, firstPage, lastPage, 72, 72, for (int i = firstPage; i <= lastPage; ++i) {
0, noCrop, !noCrop, gTrue); doc->displayPage(psOut, i, 72, 72,
0, noCrop, !noCrop, gTrue);
}
} else { } else {
delete psOut; delete psOut;
exitCode = 2; exitCode = 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment