summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTill Kamppeter <till.kamppeter@gmail.com>2007-05-08 17:41:29 +0000
committerTill Kamppeter <till.kamppeter@gmail.com>2007-05-08 17:41:29 +0000
commit697e6147babcb34120a69036237945acda10094e (patch)
tree22e38b0837b87d39d525f358e44e79e890af1171
parent262a2754c5352465e66fecb05cbba54475e8e5e0 (diff)
downloadghostpdl-697e6147babcb34120a69036237945acda10094e.tar.gz
Support for the CUPS Raster output device in the lib/*.ps files
DETAILS: CUPS-related changes, overtaken from ESP Ghostscript: Define option "-dNOMEDIAATTRS" to turn off the default (but unimplementable) media selection policies for setpagedevice. This is used by CUPS to support the standard Adobe media attributes. Without this option the behavior of Ghostscript stays as before. Due to the fact that it is not possible to properly implement the selection policies from a Ghostscript driver, the default policy was changed to "7" (impose) to avoid numerous problems with printing within CUPS... Bug fix: Martin Lottermoser, author of the "pcl3" driver writes in contrib/pcl3/doc/gs-mods.txt, section C1: There is a bug in ghostscript's default configuration for the undercolour removal and black generation functions. It shows up when printing PostScript documents using the RGB colour space ("setrgbcolor" or "sethsbcolor") on a device where the CMYK space is the native colour space; this is the case for pcl3 if you specify "-sColourModel=CMYK". The bug results in black being printed as a mixture of cyan, magenta, and yellow. The bug is simply fixed by replacing the line { pop 0 } dup setblackgeneration setundercolorremoval with the following line: {} dup setblackgeneration setundercolorremoval git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@7916 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--gs/lib/gs_init.ps18
-rw-r--r--gs/lib/gs_setpd.ps75
2 files changed, 75 insertions, 18 deletions
diff --git a/gs/lib/gs_init.ps b/gs/lib/gs_init.ps
index 5bbb6092e..a7b5d6d7e 100644
--- a/gs/lib/gs_init.ps
+++ b/gs/lib/gs_init.ps
@@ -152,6 +152,7 @@ currentdict /NOFONTMAP known /NOFONTMAP exch def
currentdict /NOFONTPATH known /NOFONTPATH exch def
currentdict /NOGC known /NOGC exch def
currentdict /NOINTERPOLATE .knownget { /INTERPOLATE exch not def } if
+currentdict /NOMEDIAATTRS known /NOMEDIAATTRS exch def
currentdict /NOOUTERSAVE known /NOOUTERSAVE exch def
currentdict /NOPAGEPROMPT known /NOPAGEPROMPT exch def
currentdict /NOPAUSE known /NOPAUSE exch def
@@ -1469,7 +1470,22 @@ setpacking
% Set the default screen and BG/UCR.
/.setdefaultbgucr {
systemdict /setblackgeneration known {
- { pop 0 } dup setblackgeneration setundercolorremoval
+% T. Kamppeter, Linux Foundation
+%
+% Martin Lottermoser, author of the "pcl3" driver writes in
+% contrib/pcl3/doc/gs-mods.txt, section C1:
+%
+% There is a bug in ghostscript's default configuration for the
+% undercolour removal and black generation functions. It shows up when
+% printing PostScript documents using the RGB colour space ("setrgbcolor" or
+% "sethsbcolor") on a device where the CMYK space is the native colour space;
+% this is the case for pcl3 if you specify "-sColourModel=CMYK". The bug
+% results in black being printed as a mixture of cyan, magenta, and yellow.
+%
+% The bug is simply fixed by replacing the line
+% { pop 0 } dup setblackgeneration setundercolorremoval
+% with the following line:
+ {} dup setblackgeneration setundercolorremoval
} if
} bind def
/.useloresscreen { % - .useloresscreen <bool>
diff --git a/gs/lib/gs_setpd.ps b/gs/lib/gs_setpd.ps
index 2edd2c88c..a7c7b9e64 100644
--- a/gs/lib/gs_setpd.ps
+++ b/gs/lib/gs_setpd.ps
@@ -164,8 +164,17 @@ level2dict begin
% We don't include attributes such as .MediaSize, which all devices
% are guaranteed to supply on their own.
/.defaultpolicies mark
- /PolicyNotFound 1
- /PageSize 0
+ % M. Sweet, Easy Software Products
+ %
+ % Due to the fact that it is not possible to properly implement
+ % the selection policies from a Ghostscript driver, we have changed
+ % the default policy to "7" (impose) to avoid numerous problems with
+ % printing within CUPS...
+ %
+ % /PolicyNotFound 1
+ % /PageSize 0
+ /PolicyNotFound 7
+ /PageSize 7
/PolicyReport {
dup /.LockSafetyParams known {
% Only possible error is invalidaccess
@@ -376,21 +385,42 @@ level2dict begin
} bind
.dicttomark readonly def
-% Define the keys used in input attribute matching.
-/.inputattrkeys [
- /PageSize /MediaColor /MediaWeight /MediaType /InsertSheet /ManualFeed
- % The following are documented in Adobe's supplement for v2017.
- /LeadingEdge /MediaClass
-] readonly def
-% Define other keys used in media selection.
-/.inputselectionkeys [
- /MediaPosition /Orientation
-] readonly def
-
-% Define the keys used in output attribute matching.
-/.outputattrkeys [
- /OutputType
-] readonly def
+% M. Sweet, Easy Software Products:
+%
+% Define NOMEDIAATTRS to turn off the default (but unimplementable) media
+% selection policies for setpagedevice. This is used by CUPS to support
+% the standard Adobe media attributes.
+NOMEDIAATTRS {
+ % Define only PageSize for input attribute matching.
+ /.inputattrkeys [
+ /PageSize
+ ] readonly def
+ % Define no other keys used in media selection.
+ /.inputselectionkeys [
+ /noInputSelectionsKeys
+ ] readonly def
+
+ % Define no keys used in output attribute matching.
+ /.outputattrkeys [
+ /noOutputAttrKeys
+ ] readonly def
+} {
+ % Define the keys used in input attribute matching.
+ /.inputattrkeys [
+ /PageSize /MediaColor /MediaWeight /MediaType /InsertSheet /ManualFeed
+ % The following are documented in Adobe's supplement for v2017.
+ /LeadingEdge /MediaClass
+ ] readonly def
+ % Define other keys used in media selection.
+ /.inputselectionkeys [
+ /MediaPosition /Orientation
+ ] readonly def
+
+ % Define the keys used in output attribute matching.
+ /.outputattrkeys [
+ /OutputType /Duplex /Tumble /ManualFeed
+ ] readonly def
+} ifelse
% Define all the parameters that should always be copied to the merged
% dictionary.
@@ -502,11 +532,22 @@ level2dict begin
% They are expected to consume the top 2 operands.
% NOTE: we currently treat all values other than 0, 1, or 7 (for PageSize)
% the same as 0, i.e., we signal an error.
+%
+% M. Sweet, Easy Software Products:
+%
+% Define NOMEDIAATTRS to turn off the default (but unimplementable) media
+% selection policies for setpagedevice. This is used by CUPS to support
+% the standard Adobe media attributes.
0 { % Set errorinfo and signal a configurationerror.
+ NOMEDIAATTRS {
+ % NOMEDIAATTRS means that the default policy is 7...
+ pop 2 index exch 7 put
+ } {
pop dup 4 index exch get 2 array astore
$error /errorinfo 3 -1 roll put
cleartomark
/setpagedevice .systemvar /configurationerror signalerror
+ } ifelse
} bind
1 { % Roll back the failed request to its previous status.
SETPDDEBUG { (Rolling back.) = pstack flush } if