title: Postscript: watermark with varying page sizes
body: <p>I am trying to use postscript to watermark postscript files. I am doing this with setpagedevice like so:</p>
  
  <pre><code>    &lt;&lt;
         /EndPage {
         exch pop 2 lt {
            /Times-Roman 40 selectfont
            .6 setgray 300 300 moveto 30 rotate (Watermark) show
            true}
            {false} ifelse
         } bind
      &gt;&gt; setpagedevice
  
      (file_to_watermark.ps) run
  </code></pre>
  
  <p>This works great, but I would like the watermark to be centered on the page, regardless of page size (this code needs to work for varying sizes of file_to_watermark.ps). My code right now is positioning the watermark based on specific coordinates, which obviously doesn't center the mark if a different file_to_watermark.ps is used with a different page size (i.e. legal, letter, etc.). Is there someway to retrieve the page size of the current file_to_watermark.ps and center-on-page the watermark based on that rather than predefined coordinates? </p>