Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overprint EPS image on a PDF

Status
Not open for further replies.

NicoZ67

Programmer
Nov 14, 2010
3
0
0
FR
Hello everyone,

I'm not very used to postscript. That's why i come here to ask for help.
I'd like to add an image on all odd page when i print a PDF. I'm using ghostscript to print the PDF. The image is a JPG that i converted to an EPS file with sam2p. I found some useful tips on the forum like this one :

/show_Logo
{
/masauvegarde save def
/showpage {} def
.5 dup scale 50 50 translate
(c:\\appli\\sharedro\\formul\\eis.eps) run

.5 dup scale 100 100 translate
(c:\\appli\\sharedro\\formul\\eid_logo.eps) run
masauvegarde restore
} bind store

The only way i found to show the image is to use the following :
show_Logo showpage

The problem is that the picture is shown on a separate page.
I don't find a way to add it on the PDF page itself.
My ghostscript command line is :
"C:\appli\statro\Impressions\gswin32c.exe" -q -dBATCH -dNOPAUSE -I"C:\appli\statro\Impressions\ghost;C:\appli\statro\Impressions\ghost\fonts" -sstdout="C:\Windows\TEMP\gs_44B6.tmp" -r300x300 -sDEVICE=ljet4 -sOutputFile="%printer%USB0001" -sPAPERSIZE=a4 -dFIXEDMEDIA -f "C:\appli\sharedro\formul\etiquette.ps" "c:\appli\sharedro\formul\_diagnostic.pdf"

Thanks for everyone who may help me with this.

Nicolas
 
Well i succeeded in that operation with the following code :
% Function that add the logo on odd page
/do_it
{
% Only show logo on odd page
MyShowPageCount 2 mod 0 eq {
% Top logo
gsave
.9 dup scale
(c:\\appli\\sharedro\\formul\\CMIM01.ps) run
grestore
% Bottom logo
gsave
.1 dup scale
500 500 translate
(c:\\appli\\sharedro\\formul\\CMIM01.ps) run
grestore
} if
} store

% Keep in memory the page number
% First page = 0, 2nd page = 1, ...
/storeshowpagecount {
exch
dup /MyShowPageCount exch store
exch
} store

% Overload the endpage call
<< /EndPage [
% Endpage is executed at the end of each page. Endpage is supplied two integers :
currentpagedevice /EndPage get /exec load
/do_it load /exec load
] cvx
>> setpagedevice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top