Hylafax Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Making cover pages



> Is there a simple (non-PostScript-guru) way to incorporate graphics
> and/or text into faxcover.ps in place of the default (Silicon Graphics)
> stuff, while leaving the rest of the form alone?
> 
> Most specifically, how would you get there from a graphics file such as
> a GIF which contains a logo?
> 
> Of course, if going the other way (incorporating the form into the logo)
> is easier, that's fine too.
> 
> I emphasize, I'm extremely PostScript-ignorant.

I'm pretty postscript ignorant as well, but have managed it, due to
a large amount of hacking.

This is as easy as I can describe it:
1) Find old logo
2) Delete logo
3) Alter text
4) Use giftops (well, giftopnm | pnmtops) or something similar
   to get postscript from image file
5) Insert this image postscript in where the logo was
6) Remove extraneous lines of this image postscript.

Detail:

1) If you edit the /usr/local/lib/fax/faxcover.ps file (after making
a copy, of course), you'll find about 58% of the way down a line
that goes
	% tom-baby's logo stuff:
which has various line drawing commands for the logo.

2) Go down a few
lines to the
	1 setlinejoin
and delete this line and everything below it until you get to the
	/drawtext {
	gsave
lines (leave them).  So, you should now have something like

	% tom-baby's logo stuff:
	
	/inch ...
	/width ...
	/r ...
	/d ...
	/R ...
	
	/drawtext {
	gsave
	
	...

3) If you leave the file like this it'll work, you'll just have no logo.
You can change the text a few (indented) lines down in the 
	  (...) show
lines - eg
	  /Helvetica-BoldOblique ...
	  (My SuperDuper) show
	  1.42 inch 9.95 inch moveto
	  /Helvetica-Bold ...
	  (Fax Server) show
	
	grestore
	} def
	
4) The following assumes you used the pnm to make a nice, readable
postscript file.  You can use this (probably) as a guide as to how
to hack a MS program created EPSF file with binary image in it -
good luck.

5) Put a couple of comments in for reference where you just cleared
out the old logo - eg.
	/d {r 30 cos mul neg} def
	/R {2 inch} def
	
	% Image will start here
	
	% Image will end here
and then using vi or something like that read in the file between
these lines.

6) Now to remove the excess stuff so it will look ok.  If you used
pnmtops you'll have something at the top of the image section like
	showpage
	%!PS-Adobe-2.0 EPSF-2.0
	%%Creator: pnmtops
	%%Title: ...
	%%Pages: 1
	%%BoundingBox: ...
	%%EndComments
	/readstring {
	  currentfile ...
Right, now delete all of these lines until the /readstring { line -
leave that one alone.  OK, now go down to your "end here" comment.
Just above it should be something like
	fffffffffffffffffffffffffffffff.....
	grestore
	showpage
	%%Trailer
Delete the showpage and %%Trailer lines, leave the rest alone.

At this stage you should be able to save & view the postscript
file.  More than likely you'll have the image in the wrong place on
the page.  To fix this fire up vi or whatever again, look for the
"start here" comment and go down a few lines.  You'll hopefully see
several lines like (with different numbers)
	270.48 326.76 translate
	71.04 108.48 scale
	0.5 0.5 translate   90 rotate  -0.5 -0.5 translate
Comment out the "0.5 0.5" line (or delete it) unless you want the
90 degree rotation.  Edit the numbers on the translate and scale line
to get the image to the right spot.  Most small images work with numbers
around (0,0 is bottom left for the translate, 100 100 means no scaling
for the scaling).
	0 700 translate
	99 66 scale
Save the change, check it out with ghostview/ghostscript, and make
changes to the numbers as appropriate.  Note that fax images don't
generally do detail very well, so I suggest keeping your image
simple, and any alphanumerics you use fairly large (or get a better
postscript converter than giftopnm | pgmtoppm | pnmtops :-).

BTW, I'll be leaving the list now, so any questions posted to the
list re this won't reach me.

I also repeat that I am *not* an authority on postscript; I worked
out the above by trial & error hacking.  So any questions re postscript
sent to me will be answered by /dev/null :-)

Avagoodone.

Peter K. Campbell



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services