HylaFAX The world's most advanced open source fax server

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

Your ps question



See %% Below, ok?

 

       /EPSbegin{save gsave 20 20 scale 200 dict begin}def
        /EPSend{end grestore restore}def


It is part of the HylaFAX v4.0 fax software and is the user customizable
part of the email-to-fax gateway.

The gateway inserts the contents of the file above before generating
the %%EndProlog marker.

I've learnt from the excellent 'First Guide to Postscript' website that
the "20 20 scale" part is magnifying up the coordinates - the gateway
generates a "0.5 dup scale" line later on in the file - so the user can
tweak the size of the image.

The Guide also implies that '/EPSbegin' and '/EPSend' are procedures, 

%% This seems to be a quick and dirty EPS file bracketing scheme. You
are right, the 20 20 scale is going to magnify by a factor of 20 in both
axis. The 0.5 is going to cut that in half, unless there is a gsave or
grestore followed by another scale somewhere else. 

but I can't see where they are used... and the procedures names cannot
be 'begin' and 'end' because they are reserved words, aren't they ??

%%procs are built as follows

/nameobject %these are marked with a forward slash. Can be nearly any
characters
{ ps code for procedure in here}  % this is the procedure body between
curly brackets. This is what the proc does when called.
def % this binds the name object with the proc body in the current
dictionary, and defines the proc for the printer

to see where the call of the two procs are, look for the name objects
EPSbegin and EPSend somewhere later, without the backslash. 
%%%%%%%
I would like to place my own header and footer in the resulting fax
image, can I achieve this though this code ? 

%%Looks like this is supposed to work like this:

EPSbegin
%put your code here
EPSend

%% I will warn you that the code defined above is not too safe. I will
post a better version that takes better care of you on the newsgroup.
Watch for it. Good luck
%% Allan


Any help, or pointers to further info, greatly appreciated.




Project hosted by iFAX Solutions