Skip to main content
Participating Frequently
June 17, 2013
Answered

make text watermark on top of background image

  • June 17, 2013
  • 15 replies
  • 4690 views

Hi ,

im using the following code that i found in the internet to create a watermark for PS file

%!PS

<<

/BeginPage {

save 200 100 moveto 60 rotate

/Times-Roman findfont 140 scalefont setfont

0.9 setgray (DRAFT) show

restore

}

>> setpagedevice

the problem is that when i have an image background the watermark is not appearing ontop of it

how can i make the watermark text appear ontop of the image ?

thanks

the image section is as follow

302 618 1829 1641 CL

GS 302 618 translate 1829 1641 scale

save

1829 1641 1829 1641 8 0 -0 IM

ffffffffffff8dff19eaffffffffffffffffffffffffffff0aff19eaffffffff

..............................

e1ff36eaffffffffffffffffffffffffedff36eaffffffffffffffffffff71ff

restore

GR

This topic has been closed for replies.
Correct answer abeddie

Hi ,

i tried ur suggestion of commenting out all the lines 0 statusdict /setpapertray get exe

but the problem now is when i have a report with more than one page its only show/print the first page ?!

i tried to put the code in many places after the 0 statusdict /setpapertray get exec but it doesnt work

i have for exmple a file with 5 pages and 5 sections as below ,

%%Page: 1 1

%%BeginPageSetup

%%BeginFeature: *PageSize Letter

%%EndFeature

%%BeginFeature: *InputSlot Upper

0 statusdict /setpapertray get exec

%%EndFeature

0 0.000 -3450.000 0 83.333 66.666 1.000 1.000 IP

%%EndPageSetup

initclip

..........

..........

%%PageTrailer

EP

%%Trailer

restore

%%Pages: 5

%%EOF


%!

% multi page test - add exch from prior version

<<

  /EndPage

  {

    exch pop 0 eq

    {

      save initgraphics

      /Times-Roman 140 selectfont

      200 100 moveto

      60 rotate

      .9 setgray

      (DRAFT) false charpath

      2 setlinewidth

      stroke

      restore

      true

    }

    {

      false

    } ifelse

  }

>> setpagedevice

1 0 0 0 setcmykcolor

72 72 500 600 rectfill

showpage

0 1 0 0 setcmykcolor

72 72 500 600 rectfill

showpage

0 0 1 0 setcmykcolor

72 72 500 600 rectfill

showpage

15 replies

Participating Frequently
June 17, 2013

BeginPage executes at the beginning or before your image. Change it to  EndPage which executes after.

Ayman__Author
Participating Frequently
June 17, 2013

thank u ,

i tried to replace BeginPage with EndPage

but it doesnt work , i got an error when opening the file using ghostview

here is the log

--- Begin offending input ---

72 ,1 \344\350\351\361\370\341\351\360\345\340\344 \352\370\343)SH

1203 194 1111 53 CL

2024 237 MT

(4353701 \344\360\360\362\370)SH

1203 247 1111 53 CL

2000 290 MT

(09-7780778 :\354\350)SH

46 141 1315 53 CL

46 188 MT

%%IncludeResource: font David-Bold-ISOLatinHebrew

/David-Bold-ISOLatinHebrew 11 1 FN

(1 University Road, POB 808)SH

SHP

%%PageTrailer

EP

%%Trailer

restore

%%Pages: 1

%%EOF

--- End offending input ---

file offset = 0

gsapi_run_string_continue returns -101

Unrecoverable error: typecheck in if

Operand stack:

    --nostringval--  2  --nostringval--


Participating Frequently
June 17, 2013

<<

  /EndPage

  {

    pop pop save initgraphics

   /Times-Roman 140 selectfont

   200 100 moveto

   60 rotate

   (DRAFT) show restore

   true

  }

>> setpagedevice

.9 0 0 setrgbcolor

72 72 500 600 rectfill

showpage

Instead of an image there is a red rectangle