diff -Nru ghostscript-9.19~dfsg+1/debian/changelog ghostscript-9.19~dfsg+1/debian/changelog --- ghostscript-9.19~dfsg+1/debian/changelog 2016-09-22 08:50:00.000000000 +0000 +++ ghostscript-9.19~dfsg+1/debian/changelog 2016-10-28 18:00:00.000000000 +0000 @@ -1,3 +1,12 @@ +ghostscript (9.19~dfsg+1-0ubuntu7) zesty; urgency=medium + + * debian/patches/020161028~0726780_gdevcups-pwgraster-bitmap-always-without-margins.patch: + "cups" output device: When creating PWG Raster output, always output + the bitmap of the full page, ignoring any unprintable margins suggested + by the PPD file (LP: #1637583). + + -- Till Kamppeter Fri, 28 Oct 2016 16:00:00 -0200 + ghostscript (9.19~dfsg+1-0ubuntu6) yakkety; urgency=medium * debian/rules: diff -Nru ghostscript-9.19~dfsg+1/debian/patches/020161028~0726780_gdevcups-pwgraster-bitmap-always-without-margins.patch ghostscript-9.19~dfsg+1/debian/patches/020161028~0726780_gdevcups-pwgraster-bitmap-always-without-margins.patch --- ghostscript-9.19~dfsg+1/debian/patches/020161028~0726780_gdevcups-pwgraster-bitmap-always-without-margins.patch 1970-01-01 00:00:00.000000000 +0000 +++ ghostscript-9.19~dfsg+1/debian/patches/020161028~0726780_gdevcups-pwgraster-bitmap-always-without-margins.patch 2016-10-28 17:55:11.000000000 +0000 @@ -0,0 +1,199 @@ +--- a/cups/gdevcups.c ++++ b/cups/gdevcups.c +@@ -3553,18 +3553,32 @@ + + cups->landscape = 0; + +- margins[0] = best_size->left / 72.0; +- margins[1] = best_size->bottom / 72.0; +- margins[2] = (best_size->width - best_size->right) / 72.0; +- margins[3] = (best_size->length - best_size->top) / 72.0; +- if (xflip == 1) ++#ifdef CUPS_RASTER_SYNCv1 ++ if (strcasecmp(cups->header.MediaClass, "PwgRaster") != 0) + { +- swap = margins[0]; margins[0] = margins[2]; margins[2] = swap; ++#endif ++ margins[0] = best_size->left / 72.0; ++ margins[1] = best_size->bottom / 72.0; ++ margins[2] = (best_size->width - best_size->right) / 72.0; ++ margins[3] = (best_size->length - best_size->top) / 72.0; ++ if (xflip == 1) ++ { ++ swap = margins[0]; margins[0] = margins[2]; margins[2] = swap; ++ } ++ if (yflip == 1) ++ { ++ swap = margins[1]; margins[1] = margins[3]; margins[3] = swap; ++ } ++#ifdef CUPS_RASTER_SYNCv1 + } +- if (yflip == 1) ++ else + { +- swap = margins[1]; margins[1] = margins[3]; margins[3] = swap; ++ margins[0] = 0.0; ++ margins[1] = 0.0; ++ margins[2] = 0.0; ++ margins[3] = 0.0; + } ++#endif + } + else + { +@@ -3661,18 +3675,32 @@ + + cups->landscape = 1; + +- margins[0] = (best_size->length - best_size->top) / 72.0; +- margins[1] = best_size->left / 72.0; +- margins[2] = best_size->bottom / 72.0; +- margins[3] = (best_size->width - best_size->right) / 72.0; +- if (xflip == 1) ++#ifdef CUPS_RASTER_SYNCv1 ++ if (strcasecmp(cups->header.MediaClass, "PwgRaster") != 0) + { +- swap = margins[1]; margins[1] = margins[3]; margins[3] = swap; ++#endif ++ margins[0] = (best_size->length - best_size->top) / 72.0; ++ margins[1] = best_size->left / 72.0; ++ margins[2] = best_size->bottom / 72.0; ++ margins[3] = (best_size->width - best_size->right) / 72.0; ++ if (xflip == 1) ++ { ++ swap = margins[1]; margins[1] = margins[3]; margins[3] = swap; ++ } ++ if (yflip == 1) ++ { ++ swap = margins[0]; margins[0] = margins[2]; margins[2] = swap; ++ } ++#ifdef CUPS_RASTER_SYNCv1 + } +- if (yflip == 1) ++ else + { +- swap = margins[0]; margins[0] = margins[2]; margins[2] = swap; ++ margins[0] = 0.0; ++ margins[1] = 0.0; ++ margins[2] = 0.0; ++ margins[3] = 0.0; + } ++#endif + } + else + { +@@ -3696,32 +3724,62 @@ + + cups->landscape = 1; + +- margins[0] = cups->PPD->custom_margins[3] / 72.0; +- margins[1] = cups->PPD->custom_margins[0] / 72.0; +- margins[2] = cups->PPD->custom_margins[1] / 72.0; +- margins[3] = cups->PPD->custom_margins[2] / 72.0; +- if (xflip == 1) ++#ifdef CUPS_RASTER_SYNCv1 ++ if (strcasecmp(cups->header.MediaClass, "PwgRaster") != 0) + { +- swap = margins[1]; margins[1] = margins[3]; margins[3] = swap; ++#endif ++ margins[0] = cups->PPD->custom_margins[3] / 72.0; ++ margins[1] = cups->PPD->custom_margins[0] / 72.0; ++ margins[2] = cups->PPD->custom_margins[1] / 72.0; ++ margins[3] = cups->PPD->custom_margins[2] / 72.0; ++ if (xflip == 1) ++ { ++ swap = margins[1]; margins[1] = margins[3]; margins[3] = swap; ++ } ++ if (yflip == 1) ++ { ++ swap = margins[0]; margins[0] = margins[2]; margins[2] = swap; ++ } ++#ifdef CUPS_RASTER_SYNCv1 + } +- if (yflip == 1) ++ else + { +- swap = margins[0]; margins[0] = margins[2]; margins[2] = swap; ++ margins[0] = 0.0; ++ margins[1] = 0.0; ++ margins[2] = 0.0; ++ margins[3] = 0.0; + } +- } else { ++#endif ++ } ++ else ++ { + /* Do not rotate */ + cups->landscape = 0; + +- for (i = 0; i < 4; i ++) +- margins[i] = cups->PPD->custom_margins[i] / 72.0; +- if (xflip == 1) ++#ifdef CUPS_RASTER_SYNCv1 ++ if (strcasecmp(cups->header.MediaClass, "PwgRaster") != 0) + { +- swap = margins[0]; margins[0] = margins[2]; margins[2] = swap; ++#endif ++ for (i = 0; i < 4; i ++) ++ margins[i] = cups->PPD->custom_margins[i] / 72.0; ++ if (xflip == 1) ++ { ++ swap = margins[0]; margins[0] = margins[2]; margins[2] = swap; ++ } ++ if (yflip == 1) ++ { ++ swap = margins[1]; margins[1] = margins[3]; margins[3] = swap; ++ } ++#ifdef CUPS_RASTER_SYNCv1 + } +- if (yflip == 1) ++ else + { +- swap = margins[1]; margins[1] = margins[3]; margins[3] = swap; ++ margins[0] = 0.0; ++ margins[1] = 0.0; ++ margins[2] = 0.0; ++ margins[3] = 0.0; + } ++#endif + } + } + } +@@ -3733,14 +3791,28 @@ + } + else + { +- /* If we do not have a PPD file, make sure that margins given via the +- input file or via something like +- "-c '<>setpagedevice'" +- on the command line are conserved */ +- margins[0] = pdev->HWMargins[0] / 72.0; +- margins[1] = pdev->HWMargins[1] / 72.0; +- margins[2] = pdev->HWMargins[2] / 72.0; +- margins[3] = pdev->HWMargins[3] / 72.0; ++#ifdef CUPS_RASTER_SYNCv1 ++ if (strcasecmp(cups->header.MediaClass, "PwgRaster") != 0) ++ { ++#endif ++ /* If we do not have a PPD file, make sure that margins given via the ++ input file or via something like ++ "-c '<>setpagedevice'" ++ on the command line are conserved */ ++ margins[0] = pdev->HWMargins[0] / 72.0; ++ margins[1] = pdev->HWMargins[1] / 72.0; ++ margins[2] = pdev->HWMargins[2] / 72.0; ++ margins[3] = pdev->HWMargins[3] / 72.0; ++#ifdef CUPS_RASTER_SYNCv1 ++ } ++ else ++ { ++ margins[0] = 0.0; ++ margins[1] = 0.0; ++ margins[2] = 0.0; ++ margins[3] = 0.0; ++ } ++#endif + } + + /* diff -Nru ghostscript-9.19~dfsg+1/debian/patches/series ghostscript-9.19~dfsg+1/debian/patches/series --- ghostscript-9.19~dfsg+1/debian/patches/series 2016-09-22 08:50:00.000000000 +0000 +++ ghostscript-9.19~dfsg+1/debian/patches/series 2016-10-28 17:54:38.000000000 +0000 @@ -1,4 +1,5 @@ 020160315~15240a6.patch +020161028~0726780_gdevcups-pwgraster-bitmap-always-without-margins.patch 1001_fix_openjp2_dynamic_linking.patch 1002_pxlmono_mediaposition_fix.patch 2001_docdir_fix_for_debian.patch