[poppler] utils/pdftocairo.cc
Carlos Garcia Campos
carlosgc at kemper.freedesktop.org
Sun Oct 30 08:07:23 PDT 2011
utils/pdftocairo.cc | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 53f1b0c5edfdbef817bff31566893ac4e111516a
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date: Sun Oct 30 16:02:19 2011 +0100
pdftocairo: Make sure beginDocument() is always called
This fixes a crash when rendering only odd/even pages in a printing
format.
diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc
index e458ee5..d0d1ec6 100644
--- a/utils/pdftocairo.cc
+++ b/utils/pdftocairo.cc
@@ -903,6 +903,10 @@ int main(int argc, char *argv[]) {
lastPage = firstPage;
}
+ // Make sure firstPage is always used so that beginDocument() is called
+ if ((printOnlyEven && firstPage % 2 == 0) || (printOnlyOdd && firstPage % 2 == 1))
+ firstPage++;
+
cairoOut = new CairoOutputDev();
cairoOut->startDoc(doc->getXRef(), doc->getCatalog());
if (sz != 0)
More information about the poppler
mailing list