home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d09xx
/
d0925.lha
/
DonsGenies
/
FrenchGenies.lha
/
Rexx
/
ImprimeAvecPost.pprx
< prev
next >
Wrap
Text File
|
1993-08-03
|
5KB
|
143 lines
/*
@BImprimeAvecPost @P @I Ecrit et ⌐ par Don Cox
@IN'est pas du Domaine Publique. Tous Droits RΘservΘs.
Traduit et amΘliorΘ par Fabien Larini le 1/08/93.
Ce GΘnies permet d'imprimer le document α l'aide de l'interprΘteur
Postscript Post. Vous devez avoir installΘ Post correctement. Vous devez
Θgalement configurer les prΘfΘrences graphiques de votre imprimante
(surtout la taille de la page et la densitΘ). L'avantage est que vous
pouvez imprimer les fichiers EPS et utiliser les fonts Adobe Type 1 plut⌠t
que leurs conversions en CG. Il demande et sauve le rΘpertoire o∙ il doit
stocker les fichiers temporaires et o∙ se trouve Post.
*/
/* PrintUsingPost */
/* This genie uses the public domain Postscript interpreter "Post" to print
your document. The advantages are that you can print .eps files on a non-Post
script printer and that you can use real Type 1 fonts, rather than converted
versions. The files "post" and "init.ps" should be in a drawer called "post"
in your "PPage:" drawer (if not, modify the indicated line in the genie), the
necessary .psfont files in CGFonts:ps, and "post.library" in libs: You do
NOT need "Conman".
Make sure the assigns for PPage: and CGFonts: are set up in your
startup-sequence or user-startup files. It is also essential to set the
Limits in your printer graphics preferences to the correct page size in
pixels i.e. the printer's dots-per-inch * page size in inches. Typical
figures are 1500 by 2100. */
/* Note: There is a bug in Post which means that it will refuse to print
colour bitmaps on colour printers under WB 2.04. It seems to be OK under
WB 1.3.
Also, gradient fills do not work in colour. Colour separations and B&W are OK.
Versions of Post older than 1.7 have problems with files from Quark XPress
and Freehand.
*/
/* Written by Don Cox. Copyright. Not Public Domain. All rights reserved. */
trace n
signal on error
signal on syntax
address command
call SafeEndEdit.rexx()
call ppm_AutoUpdate(0)
cr="0a"x
/* Demande des donnΘes a sauver dans le fichier de configuration */
fichiercfg="rexx:ImprimeAvecPost.cfg"
idem = 0
post = ""
tempdir = ""
/* Demande si nouvelle config */
if exists(fichiercfg) then do
idem = ppm_Inform(2,"Utilisation de la configuration sauvΘe ?","Non","Oui")
end
if (~exists(fichiercfg) | idem=0) then do
/* Quel est le rΘpertoire temporaire */
tempdir = ppm_GetFileName("Choix du RΘpertoire Temporaire","","")
if tempdir = "" then exit_msg("OpΘration AnnulΘe")
/* RΘcupΘration du rΘpertoire */
pos = max(lastpos("/",tempdir),lastpos(":",tempdir))
tempdir = delstr(tempdir,pos+1)
/* O∙ est Post ? */
post = ppm_GetFileName("Choix du rΘpertoire de Post", "", "post")
if post = "" then exit_msg("OpΘration AnnulΘe")
/* RΘcupΘration du rΘpertoire */
pos = max(lastpos("/",post),lastpos(":",post))
post = delstr(post,pos+1)
/* Test de la prΘsence de Post dans le rΘpertoire choisi */
if ~exists(post"post") then exit_msg("Post ne se trouve pas dans le rΘpertoire choisi")
if ppm_Inform(2,"Sauvegarder dans le fichier de configuration ?", "Non", "Oui") = 1 then do
if open(cfg,fichiercfg,"W") then do
call writeln(cfg,tempdir)
call writeln(cfg,post)
call close(cfg)
end
else
exit_msg("Impossible de sauvegarder dans le fichier de configuration")
end
end
else if idem = 1 then do
if open(cfg,fichiercfg,"R") then do
tempdir = readln(cfg)
post = readln(cfg)
call close(cfg)
end
else
exit_msg("Impossible de lire le fichier de configuration")
end
oldoutput = ppm_GetPSOutput()
call ppm_SetPSFontDownload(0)
call ppm_SetPSOutput(tempdir"IAP.ps")
success = ppm_PrintDocPS(1,1)
if success ~=1 then exit_msg("Sauvegarde temporaire du fichier Postscript impossible")
iaptemp = tempdir||"IAP"
/* Y a-t-il des espaces dans iaptempps */
iaptempps = tempdir||"IAP.ps"
if lastpos(" ",iaptempps) ~=0 then iaptempps = '22'x||iaptempps||'22'x
/* Set up a text file in temp dir and then send it to a temporary command window */
conwindow = "CON:40/40/500/200/NewWindow"
call open out, iaptemp, write /* This wipes out any existing ram:temp */
call writeln out, "cd "post /* post is in drawer "Post" in "PPage:" - if not, change this line */
call writeln out, "post init.ps "iaptempps /* To use lots of fonts in one document, add memory to Post here. See Post documentation. */
call writeln out, "delete "iaptempps
call writeln out, "endcli"
call close out
/* Y a-t-il des espaces dans iaptemp */
if lastpos(" ",iaptemp) ~=0 then iaptemp = '22'x||iaptemp||'22'x
"newcli" conwindow iaptemp
call ppm_SetPSOutput(oldoutput)
call exit_msg()
end
error:
syntax:
do
exit_msg("ArrΩt du GΘnie d√ α l'erreur: "errortext(rc))
end
exit_msg:
do
parse arg message
if message ~= "" then
call ppm_Inform(1,message,)
call ppm_ClearStatus()
call ppm_PPageToFront()
call ppm_AutoUpdate(1)
exit
end