You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB

1 month ago
  1. %!PS
  2. % Postscript that uses Ghostscript extensions to do simple transparency
  3. /PageUsesTransparency true def
  4. systemdict /.setalphaisshape known not
  5. {
  6. (\n\n%%%% WARNING: Transparency operations ignored - need to include -dALLOWPSTRANSPARENCY\n\n) print flush
  7. /.pushpdf14devicefilter {pop} bind def
  8. /.begintransparencygroup {pop pop pop pop pop} bind def
  9. /.endtransparencygroup {} bind def
  10. /.poppdf14devicefilter {} bind def
  11. /.setfillconstantalpha {pop} bind def
  12. /.setstrokeconstantalpha {pop} bind def
  13. /PageUsesTransparency false def
  14. } if
  15. <<
  16. /PageUsesTransparency PageUsesTransparency % needed if we are using transparency
  17. /CompatibilityLevel 1.4
  18. /PageSpotColors 0
  19. >> setpagedevice % in case we are going to pdfwrite
  20. % work around rectfill mapping directly to device fill_rectangle
  21. /rectfill {
  22. gsave 4 2 roll moveto 1 index 0 rlineto
  23. 0 exch rlineto neg 0 rlineto closepath fill grestore
  24. } bind def
  25. 0 .pushpdf14devicefilter % depth .pushpdf14devicefilter -
  26. .5 .9 .2 setrgbcolor
  27. 0 0 300 700 rectfill
  28. .2 .5 .9 setrgbcolor
  29. 200 100 400 400 rectfill
  30. << >> clippath pathbbox newpath .begintransparencygroup
  31. .5 .setfillconstantalpha
  32. .9 .3 .1 setrgbcolor
  33. 100 200 500 500 rectfill
  34. .endtransparencygroup
  35. .poppdf14devicefilter
  36. showpage