diff -u poppler-0.10.5/debian/changelog poppler-0.10.5/debian/changelog --- poppler-0.10.5/debian/changelog +++ poppler-0.10.5/debian/changelog @@ -1,3 +1,11 @@ +poppler (0.10.5-1ubuntu2.2) jaunty-proposed; urgency=low + + * debian/patches/20_pdftops-multiple-page-size-support.patch: Made new + page-size-conserving PostScript output mode working together with Duplex, + (LP: #382379). + + -- Till Kamppeter Mon, 22 Jun 2009 16:43:49 +0200 + poppler (0.10.5-1ubuntu2.1) jaunty-proposed; urgency=low * debian/patches/25_poppler-ps-output-broken-binary-encoding-fix.patch: diff -u poppler-0.10.5/debian/patches/20_pdftops-multiple-page-size-support.patch poppler-0.10.5/debian/patches/20_pdftops-multiple-page-size-support.patch --- poppler-0.10.5/debian/patches/20_pdftops-multiple-page-size-support.patch +++ poppler-0.10.5/debian/patches/20_pdftops-multiple-page-size-support.patch @@ -1,6 +1,6 @@ diff -Nur -x '*.orig' -x '*~' poppler-0.11.0/poppler/PSOutputDev.cc poppler-0.11.0.new/poppler/PSOutputDev.cc --- poppler-0.11.0/poppler/PSOutputDev.cc 2009-05-11 19:59:09.000000000 +0200 -+++ poppler-0.11.0.new/poppler/PSOutputDev.cc 2009-06-03 14:34:12.000000000 +0200 ++++ poppler-0.11.0.new/poppler/PSOutputDev.cc 2009-06-22 16:40:04.000000000 +0200 @@ -1269,6 +1269,7 @@ Object info, obj1; @@ -9,15 +9,17 @@ case psModePS: writePS("%!PS-Adobe-3.0\n"); break; -@@ -1299,6 +1300,7 @@ +@@ -1299,6 +1300,9 @@ writePS("%%DocumentSuppliedResources: (atend)\n"); switch (mode) { + case psModePSOrigPageSizes: ++ prevWidth = 0; ++ prevHeight = 0; case psModePS: writePSFmt("%%DocumentMedia: plain {0:d} {1:d} 0 () ()\n", paperWidth, paperHeight); -@@ -3122,7 +3124,7 @@ +@@ -3122,7 +3132,7 @@ GBool landscape; @@ -26,7 +28,7 @@ GooString pageLabel; const GBool gotLabel = m_catalog->indexToLabel(pageNum -1, &pageLabel); if (gotLabel) { -@@ -3137,7 +3139,8 @@ +@@ -3137,7 +3147,8 @@ } else { writePSFmt("%%Page: {0:d} {1:d}\n", pageNum, seqPage); } @@ -36,7 +38,7 @@ } // underlays -@@ -3150,6 +3153,29 @@ +@@ -3150,6 +3161,35 @@ switch (mode) { @@ -56,7 +58,13 @@ + writePS("%%BeginPageSetup\n"); + writePSFmt("%%PageOrientation: {0:s}\n", + landscape ? "Landscape" : "Portrait"); -+ writePSFmt("<> setpagedevice\n", width, height); ++ if ((width != prevWidth) || (height != prevHeight)) { ++ // Set page size only when it actually changes, as otherwise Duplex ++ // printing does not work ++ writePSFmt("<> setpagedevice\n", width, height); ++ prevWidth = width; ++ prevHeight = height; ++ } + writePS("pdfStartPage\n"); + writePSFmt("{0:d} {1:d} {2:d} {3:d} re W\n", x1, y1, x2 - x1, y2 - y1); + writePS("%%EndPageSetup\n"); @@ -68,7 +76,7 @@ imgWidth = imgURX - imgLLX; diff -Nur -x '*.orig' -x '*~' poppler-0.11.0/poppler/PSOutputDev.h poppler-0.11.0.new/poppler/PSOutputDev.h --- poppler-0.11.0/poppler/PSOutputDev.h 2009-05-11 19:59:09.000000000 +0200 -+++ poppler-0.11.0.new/poppler/PSOutputDev.h 2009-06-03 14:20:38.000000000 +0200 ++++ poppler-0.11.0.new/poppler/PSOutputDev.h 2009-06-22 16:40:04.000000000 +0200 @@ -53,7 +53,8 @@ enum PSOutMode { psModePS, @@ -79,9 +87,20 @@ }; enum PSFileType { +@@ -333,6 +334,10 @@ + PSOutMode mode; // PostScript mode (PS, EPS, form) + int paperWidth; // width of paper, in pts + int paperHeight; // height of paper, in pts ++ int prevWidth; // width of previous page ++ // (only psModePSOrigPageSizes output mode) ++ int prevHeight; // height of previous page ++ // (only psModePSOrigPageSizes output mode) + int imgLLX, imgLLY, // imageable area, in pts + imgURX, imgURY; + GBool preload; // load all images into memory, and diff -Nur -x '*.orig' -x '*~' poppler-0.11.0/utils/pdftops.cc poppler-0.11.0.new/utils/pdftops.cc --- poppler-0.11.0/utils/pdftops.cc 2008-11-08 20:00:30.000000000 +0100 -+++ poppler-0.11.0.new/utils/pdftops.cc 2009-06-03 14:20:38.000000000 +0200 ++++ poppler-0.11.0.new/utils/pdftops.cc 2009-06-22 16:39:56.000000000 +0200 @@ -74,6 +74,7 @@ static GBool level2Sep = gFalse; static GBool level3 = gFalse;