summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/context/ruby/graphics/gs.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/context/ruby/graphics/gs.rb')
-rw-r--r--Master/texmf-dist/scripts/context/ruby/graphics/gs.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/Master/texmf-dist/scripts/context/ruby/graphics/gs.rb b/Master/texmf-dist/scripts/context/ruby/graphics/gs.rb
index 070fd1be85a..cb3d016f4cb 100644
--- a/Master/texmf-dist/scripts/context/ruby/graphics/gs.rb
+++ b/Master/texmf-dist/scripts/context/ruby/graphics/gs.rb
@@ -296,9 +296,9 @@ class GhostScript
def gscolorswitch
case getvariable('colormodel')
- when 'cmyk' then '-dProcessColorModel=/DeviceCMYK '
- when 'rgb' then '-dProcessColorModel=/DeviceRGB '
- when 'gray' then '-dProcessColorModel=/DeviceGRAY '
+ when 'cmyk' then '-dProcessColorModel=/DeviceCMYK -dColorConversionStrategy=/CMYK '
+ when 'rgb' then '-dProcessColorModel=/DeviceRGB -dColorConversionStrategy=/RGB '
+ when 'gray' then '-dProcessColorModel=/DeviceGRAY -dColorConversionStrategy=/GRAY '
else
''
end
@@ -452,10 +452,10 @@ class GhostScript
debug('bbox spec', bbox)
- if bbox =~ /(Exact|HiRes)BoundingBox:#{@@bboxspec}/mois then
+ if bbox =~ /(Exact|HiRes)BoundingBox:#{@@bboxspec}/moi then
debug("high res bbox #{$2} #{$3} #{$4} #{$5}")
setdimensions($2,$3,$4,$5)
- elsif bbox =~ /BoundingBox:#{@@bboxspec}/mois
+ elsif bbox =~ /BoundingBox:#{@@bboxspec}/moi
debug("low res bbox #{$1} #{$2} #{$3} #{$4}")
setdimensions($1,$2,$3,$4)
end
@@ -570,7 +570,12 @@ end
if ! epsbbox && str =~ /^%%(Page:|EndProlog)/io then
out.puts(str) if $1 == "EndProlog"
debug('faking papersize')
- out.puts("<< /PageSize [#{@width} #{@height}] >> setpagedevice\n")
+ # out.puts("<< /PageSize [#{@width} #{@height}] >> setpagedevice\n")
+ if ! dimensions? then
+ out.puts("<< /PageSize [1 1] >> setpagedevice\n")
+ else
+ out.puts("<< /PageSize [#{@width} #{@height}] >> setpagedevice\n")
+ end
out.puts("gsave #{@xoffset} #{@yoffset} translate\n")
epsbbox = true
elsif str =~ /^%%BeginBinary\:\s*\d+\s*$/o then