×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Stamp (not watermark) PDF file

Stamp (not watermark) PDF file

Stamp (not watermark) PDF file

(OP)
This script "watermark.ps" creates a watermark (=text in background) on each PDF page:

'<<
/BeginPage
{ gsave
/Helvetica_Bold findfont 72 scalefont setfont
.75 setgray 130 70 moveto 50 rotate Watermark show
grestore
} bind
>> setpagedevice

gs -q -dNOPAUSE -dSAFER -dBATCH -sOutputFile=output.pdf -sDEVICE=pdfwrite watermark.ps -f myfile.pdf

Any idea how to rewrite it to create a stamp (=text in foreground) on each PDF page?

RE: Stamp (not watermark) PDF file


Hi,

I dont know if it's late, but you could use /EndPage instead of /BeginPage to achieve that.

Something like this:

CODE --> PS

/watermarkText { (WATERMARK TEXT) } def
/watermarkFont { /Helvetica-Bold 72 selectfont } def
/watermarkColor { .75 setgray } def
/watermarkAngle { 45 } def

/pageWidth { currentpagedevice /PageSize get 0 get } def
/pageHeight { currentpagedevice /PageSize get 1 get } def
			
<<
	/EndPage {
		2 eq { pop false } 
		{
			gsave
			watermarkFont
			watermarkColor
			pageWidth .5 mul pageHeight .5 mul translate
			0 0 moveto
			watermarkText false charpath flattenpath pathbbox
			4 2 roll pop pop
			0 0 moveto
			watermarkAngle rotate
			-.5 mul exch -.5 mul exch
			rmoveto
			watermarkText show
			grestore 
			true 
		} ifelse
	} bind
>> setpagedevice 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close