~ubuntu-branches/ubuntu/jaunty/ghostscript/jaunty-updates

« back to all changes in this revision

Viewing changes to debian/patches/60_pxl-cups-driver-pdf.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2009-01-20 16:40:45 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090120164045-lnfhi0n30o5lwhwa
Tags: 8.64.dfsg.1~svn9377-0ubuntu1
* New upstream release (SVN rev 9377)
   o Fixes many bugs concerning PDF rendering, to make the PDF printing
     workflow correctly working.
   o Fixes long-standing bugs in many drivers, like input paper tray and
     duplex options not working for the built-in PCL 4, 5, 5c, 5e, and
     6/XL drivers, PDF input not working for bjc600, bjc800, and cups
     output devices, several options not working and uninitialized
     memory with cups output device.
   o Merged nearly all patches of the Ubuntu and Debian packages upstream.
   o Fixes LP: #317810, LP: #314439, LP: #314018.
* debian/patches/03_libpaper_support.dpatch,
  debian/patches/11_gs-cjk_font_glyph_handling_fix.dpatch,
  debian/patches/12_gs-cjk_vertical_writing_metrics_fix.dpatch,
  debian/patches/13_gs-cjk_cjkps_examples.dpatch,
  debian/patches/20_bbox_segv_fix.dpatch,
  debian/patches/21_brother_7x0_gdi_fix.dpatch,
  debian/patches/22_epsn_margin_workaround.dpatch,
  debian/patches/24_gs_man_fix.dpatch,
  debian/patches/25_toolbin_insecure_tmp_usage_fix.dpatch,
  debian/patches/26_assorted_script_fixes.dpatch,
  debian/patches/29_gs_css_fix.dpatch,
  debian/patches/30_ps2pdf_man_improvement.dpatch,
  debian/patches/31_fix-gc-sigbus.dpatch,
  debian/patches/34_ftbfs-on-hurd-fix.dpatch,
  debian/patches/35_disable_libcairo.dpatch,
  debian/patches/38_pxl-duplex.dpatch,
  debian/patches/39_pxl-resolution.dpatch,
  debian/patches/42_gs-init-ps-delaybind-fix.dpatch,
  debian/patches/45_bjc600-bjc800-pdf-input.dpatch,
  debian/patches/48_cups-output-device-pdf-duplex-uninitialized-memory-fix.dpatch,
  debian/patches/50_lips4-floating-point-exception.dpatch,
  debian/patches/52_cups-device-logging.dpatch,
  debian/patches/55_pcl-input-slot-fix.dpatch,
  debian/patches/57_pxl-input-slot-fix.dpatch,
  debian/patches/60_pxl-cups-driver-pdf.dpatch,
  debian/patches/62_onebitcmyk-pdf.dpatch,
  debian/patches/65_too-big-temp-files-1.dpatch,
  debian/patches/67_too-big-temp-files-2.dpatch,
  debian/patches/70_take-into-account-data-in-stream-buffer-before-refill.dpatch:
  Removed, applied upstream.
* debian/patches/01_docdir_fix_for_debian.dpatch,
  debian/patches/02_gs_man_fix_debian.dpatch,
  debian/patches/01_docdir-fix-for-debian.dpatch,
  debian/patches/02_docdir-fix-for-debian.dpatch: Renamed patches to
  make merging with Debian easier.
* debian/patches/32_improve-handling-of-media-size-changes-from-gv.dpatch, 
  debian/patches/33_bad-params-to-xinitimage-on-large-bitmaps.dpatch:
  regenerated for new source directory structure.
* debian/rules: Corrected paths to remove cidfmap (it is in Resource/Init/
  in GS 8.64) and to install headers (source paths are psi/ and base/ now).
* debian/rules: Remove all fontmaps, as DeFoMa replaces them.
* debian/local/pdftoraster/pdftoraster.c,
  debian/local/pdftoraster/pdftoraster.convs, debian/rules: Removed
  added pdftoraster filter and use the one which comes with Ghostscript.
* debian/ghostscript.links: s/8.63/8.64/

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## 60_pxl-cups-driver-pdf.dpatch by  <till.kamppeter@gmail.com>
3
 
##
4
 
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: No description.
6
 
 
7
 
@DPATCH@
8
 
diff -urNad ghostscript-8.63.dfsg.1~/cups/pstopxl.in ghostscript-8.63.dfsg.1/cups/pstopxl.in
9
 
--- ghostscript-8.63.dfsg.1~/cups/pstopxl.in    2007-12-05 01:08:50.000000000 +0100
10
 
+++ ghostscript-8.63.dfsg.1/cups/pstopxl.in     2008-11-26 11:21:02.000000000 +0100
11
 
@@ -1,6 +1,6 @@
12
 
 #!/bin/sh
13
 
 #
14
 
-# "$Id: pstopxl.in,v 1.1.2.2 2004/06/29 13:15:10 mike Exp $"
15
 
+# "$Id: pstopxl.in 9239 2008-11-24 19:15:04Z till $"
16
 
 #
17
 
 # CUPS PCL XL/PCL 6 filter script for Ghostscript.
18
 
 #
19
 
@@ -45,23 +45,144 @@
20
 
     device="pxlmono"
21
 
 fi
22
 
 
23
 
+# Apply PPD settings.
24
 
+
25
 
+ps_code=
26
 
+ppd_opts=
27
 
+
28
 
+resolution=
29
 
+eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)Resolution=([0-9.]+(x[0-9.]+)?).*/resolution="${resolution:-\2}"/p')"
30
 
+if test -e "$PPD"; then
31
 
+  eval "$(sed -nre 's/^\*DefaultResolution:\s+([0-9.]+(x[0-9.]+)?).*/resolution="${resolution:-\1}"/p' "$PPD")"
32
 
+fi
33
 
+echo "DEBUG: Resolution: $resolution" >&2
34
 
+if test -n "$resolution"; then
35
 
+  ppd_opts="${ppd_opts:+$ppd_opts }-r$resolution"
36
 
+fi
37
 
+
38
 
+pagesize=
39
 
+eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)(media|PageSize)=(\S+).*/pagesize="${pagesize:-\3}"/p')"
40
 
+if test -e "$PPD"; then
41
 
+  eval "$(sed -nre 's/^\*DefaultPageSize:\s+(\S+).*/pagesize="${pagesize:-\1}"/p' "$PPD")"
42
 
+fi
43
 
+echo "DEBUG: Page size: $pagesize" >&2
44
 
+width=
45
 
+height=
46
 
+if test -n "$pagesize" && test -e "$PPD"; then
47
 
+  eval "$(sed -nre 's|^\*PaperDimension\s+'"$pagesize"'/[^:]+:\s+"(\S+)\s+(\S+)".*|width="\1"; height="\2"|p' "$PPD")"
48
 
+fi
49
 
+echo "DEBUG: Width: $width, height: $height" >&2
50
 
+if test -n "$width"; then
51
 
+  ppd_opts="${ppd_opts:+$ppd_opts }-dDEVICEWIDTHPOINTS=$width"
52
 
+fi
53
 
+if test -n "$height"; then
54
 
+  ppd_opts="${ppd_opts:+$ppd_opts }-dDEVICEHEIGHTPOINTS=$height"
55
 
+fi
56
 
+
57
 
+bl_x=
58
 
+bl_y=
59
 
+tr_x=
60
 
+tr_y=
61
 
+if test -n "$pagesize" && test -e "$PPD"; then
62
 
+  eval "$(sed -nre 's|^\*ImageableArea\s+'"$pagesize"'/[^:]+:\s+"(\S+)\s+(\S+)\s+(\S+)\s+(\S+)".*|bl_x="\1"; bl_y="\2"; tr_x="\3"; tr_y="\4"|p' "$PPD")"
63
 
+fi
64
 
+echo "DEBUG: Absolute margins: $bl_x, $bl_y, $tr_x, $tr_y" >&2
65
 
+margin_l=
66
 
+margin_b=
67
 
+margin_r=
68
 
+margin_t=
69
 
+if test -n "$width" && test -n "$height" && \
70
 
+   test -n "$bl_x" && test -n "$bl_y" && \
71
 
+   test -n "$tr_x" && test -n "$tr_y"; then
72
 
+  margin_l="$bl_x"
73
 
+  margin_b="$bl_y"
74
 
+  margin_r="$(printf "scale=8; (%s)-(%s)\n" "$width" "$tr_x" | bc)"
75
 
+  margin_t="$(printf "scale=8; (%s)-(%s)\n" "$height" "$tr_y" | bc)"
76
 
+fi
77
 
+echo "DEBUG: Relative margins: $margin_l, $margin_b, $margin_r, $margin_t" >&2
78
 
+if test -n "$margin_l" && test -n "$margin_b" && \
79
 
+   test -n "$margin_r" && test -n "$margin_t"; then
80
 
+  ps_code="${ps_code:+$ps_code }<</.HWMargins[$margin_l $margin_b $margin_r $margin_t] /Margins[0 0]>>setpagedevice"
81
 
+fi
82
 
+
83
 
+inputslot=
84
 
+eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)(InputSlot)=(\S+).*/inputslot="${inputslot:-\3}"/p')"
85
 
+if test -e "$PPD"; then
86
 
+  eval "$(sed -nre 's/^\*DefaultInputSlot:\s+(\S+).*/inputslot="${inputslot:-\1}"/p' "$PPD")"
87
 
+fi
88
 
+echo "DEBUG: InputSlot: $inputslot" >&2
89
 
+inputslot_val=
90
 
+if test -n "$inputslot" && test -e "$PPD"; then
91
 
+  eval "$(sed -nre 's|^\*InputSlot\s+'"$inputslot"'/[^:]+:\s+"\s*<\s*<\s*/MediaPosition\s*([0-9]+)\s*>\s*>\s*setpagedevice\s*".*|inputslot_val="\1"|p' "$PPD")"
92
 
+fi
93
 
+echo "DEBUG: Value for MediaPosition: $inputslot_val" >&2
94
 
+if test -n "$inputslot_val"; then
95
 
+  ppd_opts="${ppd_opts:+$ppd_opts }-dMediaPosition=$inputslot_val"
96
 
+fi
97
 
+
98
 
+colormodel=
99
 
+eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)(ColorModel)=(\S+).*/colormodel="${colormodel:-\3}"/p')"
100
 
+if test -e "$PPD"; then
101
 
+  eval "$(sed -nre 's/^\*DefaultColorModel:\s+(\S+).*/colormodel="${colormodel:-\1}"/p' "$PPD")"
102
 
+fi
103
 
+echo "DEBUG: ColorModel: $colormodel" >&2
104
 
+colormodel_val=
105
 
+if test -n "$colormodel" && test -e "$PPD"; then
106
 
+  eval "$(sed -nre 's|^\*ColorModel\s+'"$colormodel"'/[^:]+:\s+"\s*<\s*<\s*/BitsPerPixel\s*([0-9]*)\s*>\s*>\s*setpagedevice\s*".*|colormodel_val="\1"|p' "$PPD")"
107
 
+fi
108
 
+echo "DEBUG: Value for BitsPerPixel: $colormodel_val" >&2
109
 
+if test -n "$colormodel_val"; then
110
 
+  ppd_opts="${ppd_opts:+$ppd_opts }-dBitsPerPixel=$colormodel_val"
111
 
+fi
112
 
+
113
 
+duplex=
114
 
+eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)(Duplex)=(\S+).*/duplex="${duplex:-\3}"/p')"
115
 
+if test -e "$PPD"; then
116
 
+  eval "$(sed -nre 's/^\*DefaultDuplex:\s+(\S+).*/duplex="${duplex:-\1}"/p' "$PPD")"
117
 
+fi
118
 
+echo "DEBUG: Duplex: $duplex" >&2
119
 
+duplex_val=
120
 
+tumble_val=
121
 
+if test -n "$duplex" && test -e "$PPD"; then
122
 
+  eval "$(sed -nre 's|^\*Duplex\s+'"$duplex"'/[^:]+:\s+"\s*<\s*<\s*/Duplex\s*(\S*)\s*(/Tumble\s*(\S*)\s*)?>\s*>\s*setpagedevice\s*".*|duplex_val="\1"; tumble_val="\3"|p' "$PPD")"
123
 
+fi
124
 
+echo "DEBUG: Value for Duplex: $duplex_val; Value for Tumble: $tumble_val" >&2
125
 
+if test -n "$duplex_val"; then
126
 
+  ppd_opts="${ppd_opts:+$ppd_opts }-dDuplex=$duplex_val"
127
 
+fi
128
 
+if test -n "$tumble_val"; then
129
 
+  ppd_opts="${ppd_opts:+$ppd_opts }-dTumble=$tumble_val"
130
 
+fi
131
 
+
132
 
+
133
 
+echo "DEBUG: PPD options: $ppd_opts" >&2
134
 
+echo "DEBUG: PostScript code from options: $ps_code" >&2
135
 
+
136
 
 # Options we use with Ghostscript...
137
 
-gsopts="-dQUIET -dDEBUG -dPARANOIDSAFER -dNOPAUSE -dBATCH"
138
 
-gsopts="$gsopts -dNOMEDIAATTRS -sDEVICE=$device -sstdout=%stderr"
139
 
+gsopts="-dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH"
140
 
+gsopts="$gsopts -sDEVICE=$device -sstdout=%stderr"
141
 
 
142
 
 # See if we have a filename on the command-line...
143
 
-if test -z "$6"; then
144
 
-       ifile="-_"
145
 
-else
146
 
-       ifile="$6"
147
 
+if [ -n "$6" ]; then
148
 
+  exec <"$6"
149
 
 fi
150
 
 
151
 
+# We read the data into a temporary file as Ghostscript needs this to be
152
 
+# able to also work with PDF input
153
 
+tempfiles=
154
 
+trap 'rm -f $tempfiles' 0 1 2 13 15
155
 
+
156
 
+ifile=$(mktemp -t pstopxl.XXXXXX)
157
 
+tempfiles="$tempfiles $ifile"
158
 
+
159
 
+cat >"$ifile"
160
 
+
161
 
 echo INFO: Starting GPL Ghostscript `$bindir/@GS@ --version`... 1>&2
162
 
-echo DEBUG: Running $bindir/@GS@ $gsopts -sOUTPUTFILE="%stdout" "$ifile" 1>&2
163
 
+echo DEBUG: Running $bindir/@GS@ $gsopts $ppd_opts -sOUTPUTFILE="%stdout" -c "$ps_code" -f "$ifile" 1>&2
164
 
 
165
 
 # Now run Ghostscript...
166
 
-exec $bindir/@GS@ $gsopts -sOUTPUTFILE="%stdout" "$ifile"
167
 
+$bindir/@GS@ $gsopts $ppd_opts -sOUTPUTFILE="%stdout" -c "$ps_code" -f "$ifile"
168
 
 
169
 
 #
170
 
-# End of "$Id: pstopxl.in,v 1.1.2.2 2004/06/29 13:15:10 mike Exp $".
171
 
+# End of "$Id: pstopxl.in 9239 2008-11-24 19:15:04Z till $".
172
 
 #
173
 
diff -urNad ghostscript-8.63.dfsg.1~/cups/pxlcolor.ppd ghostscript-8.63.dfsg.1/cups/pxlcolor.ppd
174
 
--- ghostscript-8.63.dfsg.1~/cups/pxlcolor.ppd  2007-09-08 19:05:59.000000000 +0200
175
 
+++ ghostscript-8.63.dfsg.1/cups/pxlcolor.ppd   2008-11-26 11:20:54.000000000 +0100
176
 
@@ -1,6 +1,6 @@
177
 
 *PPD-Adobe: "4.3"
178
 
 *%
179
 
-*% "$Id: pxlcolor.ppd,v 1.1.2.1 2003/07/20 22:54:45 mike Exp $"
180
 
+*% "$Id: pxlcolor.ppd 9239 2008-11-24 19:15:04Z till $"
181
 
 *%
182
 
 *%   Sample color PCL XL/PCL 6 driver PPD file for the Common UNIX
183
 
 *%   Printing System (CUPS).
184
 
@@ -32,7 +32,8 @@
185
 
 *Product:      "(GPL Ghostscript)"
186
 
 *cupsVersion:  1.1
187
 
 *cupsManualCopies: False
188
 
-*cupsFilter:   "application/vnd.cups-postscript 0 pstopxl"
189
 
+*cupsFilter:   "application/vnd.cups-postscript 100 pstopxl"
190
 
+*cupsFilter:   "application/vnd.cups-pdf 0 pstopxl"
191
 
 *ModelName:     "HP Color LaserJet Series PCL 6"
192
 
 *ShortNickName: "HP Color LaserJet Series PCL 6"
193
 
 *NickName:      "HP Color LaserJet Series PCL 6 CUPS"
194
 
@@ -54,6 +55,15 @@
195
 
 *UIConstraints: *PageSize A5 *InputSlot Envelope
196
 
 *UIConstraints: *PageSize B5 *InputSlot Envelope
197
 
 *UIConstraints:        *Duplex *OptionDuplex False
198
 
+*UIConstraints: *InputSlot Envelope *PageSize Executive
199
 
+*UIConstraints: *InputSlot Envelope *PageSize Letter
200
 
+*UIConstraints: *InputSlot Envelope *PageSize Legal
201
 
+*UIConstraints: *InputSlot Envelope *PageSize Tabloid
202
 
+*UIConstraints: *InputSlot Envelope *PageSize A3
203
 
+*UIConstraints: *InputSlot Envelope *PageSize A4
204
 
+*UIConstraints: *InputSlot Envelope *PageSize A5
205
 
+*UIConstraints: *InputSlot Envelope *PageSize B5
206
 
+*UIConstraints:        *OptionDuplex False *Duplex
207
 
 
208
 
 *OpenUI *PageSize/Media Size: PickOne
209
 
 *OrderDependency: 10 AnySetup *PageSize
210
 
@@ -143,10 +153,11 @@
211
 
 
212
 
 *OpenUI *Resolution/Output Resolution: PickOne
213
 
 *OrderDependency: 20 AnySetup *Resolution
214
 
-*DefaultResolution: 300dpi
215
 
+*DefaultResolution: 600dpi
216
 
 *Resolution 150dpi/150 DPI: "<</HWResolution[150 150]>>setpagedevice"
217
 
 *Resolution 300dpi/300 DPI: "<</HWResolution[300 300]>>setpagedevice"
218
 
 *Resolution 600dpi/600 DPI: "<</HWResolution[600 600]>>setpagedevice"
219
 
+*Resolution 1200dpi/1200 DPI: "<</HWResolution[1200 1200]>>setpagedevice"
220
 
 *CloseUI: *Resolution
221
 
 
222
 
 *OpenUI *Duplex/Double-Sided Printing: PickOne
223
 
@@ -202,5 +213,5 @@
224
 
 *Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
225
 
 *Font ZapfDingbats: Special "(001.004S)" Standard ROM
226
 
 *%
227
 
-*% End of "$Id: pxlcolor.ppd,v 1.1.2.1 2003/07/20 22:54:45 mike Exp $".
228
 
+*% End of "$Id: pxlcolor.ppd 9239 2008-11-24 19:15:04Z till $".
229
 
 *%
230
 
diff -urNad ghostscript-8.63.dfsg.1~/cups/pxlmono.ppd ghostscript-8.63.dfsg.1/cups/pxlmono.ppd
231
 
--- ghostscript-8.63.dfsg.1~/cups/pxlmono.ppd   2007-09-08 19:05:59.000000000 +0200
232
 
+++ ghostscript-8.63.dfsg.1/cups/pxlmono.ppd    2008-11-26 11:20:54.000000000 +0100
233
 
@@ -1,6 +1,6 @@
234
 
 *PPD-Adobe: "4.3"
235
 
 *%
236
 
-*% "$Id: pxlmono.ppd,v 1.1.2.1 2003/07/20 22:54:45 mike Exp $"
237
 
+*% "$Id: pxlmono.ppd 9239 2008-11-24 19:15:04Z till $"
238
 
 *%
239
 
 *%   Sample monochrome PCL XL/PCL 6 driver PPD file for the Common UNIX
240
 
 *%   Printing System (CUPS).
241
 
@@ -32,7 +32,8 @@
242
 
 *Product:      "(GPL Ghostscript)"
243
 
 *cupsVersion:  1.1
244
 
 *cupsManualCopies: False
245
 
-*cupsFilter:   "application/vnd.cups-postscript 0 pstopxl"
246
 
+*cupsFilter:   "application/vnd.cups-postscript 100 pstopxl"
247
 
+*cupsFilter:   "application/vnd.cups-pdf 0 pstopxl"
248
 
 *ModelName:     "HP LaserJet Series PCL 6"
249
 
 *ShortNickName: "HP LaserJet Series PCL 6"
250
 
 *NickName:      "HP LaserJet Series PCL 6 CUPS"
251
 
@@ -54,6 +55,15 @@
252
 
 *UIConstraints: *PageSize A5 *InputSlot Envelope
253
 
 *UIConstraints: *PageSize B5 *InputSlot Envelope
254
 
 *UIConstraints:        *Duplex *OptionDuplex False
255
 
+*UIConstraints: *InputSlot Envelope *PageSize Executive
256
 
+*UIConstraints: *InputSlot Envelope *PageSize Letter
257
 
+*UIConstraints: *InputSlot Envelope *PageSize Legal
258
 
+*UIConstraints: *InputSlot Envelope *PageSize Tabloid
259
 
+*UIConstraints: *InputSlot Envelope *PageSize A3
260
 
+*UIConstraints: *InputSlot Envelope *PageSize A4
261
 
+*UIConstraints: *InputSlot Envelope *PageSize A5
262
 
+*UIConstraints: *InputSlot Envelope *PageSize B5
263
 
+*UIConstraints:        *OptionDuplex False *Duplex
264
 
 
265
 
 *OpenUI *PageSize/Media Size: PickOne
266
 
 *OrderDependency: 10 AnySetup *PageSize
267
 
@@ -196,5 +206,5 @@
268
 
 *Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
269
 
 *Font ZapfDingbats: Special "(001.004S)" Standard ROM
270
 
 *%
271
 
-*% End of "$Id: pxlmono.ppd,v 1.1.2.1 2003/07/20 22:54:45 mike Exp $".
272
 
+*% End of "$Id: pxlmono.ppd 9239 2008-11-24 19:15:04Z till $".
273
 
 *%