[poppler] Branch 'poppler-0.18' - utils/pdftocairo.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sun Oct 30 08:04:10 PDT 2011


 utils/pdftocairo.cc |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit e4a2adb02969e872e37e408ced4c39131c6751ea
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..1b67c90 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 && pg % 2 == 0) || (printOnlyOdd && pg % 2 == 1))
+    firstPage++;
+
   cairoOut = new CairoOutputDev();
   cairoOut->startDoc(doc->getXRef(), doc->getCatalog());
   if (sz != 0)


More information about the poppler mailing list