[comp.sys.mac.programmer] LaserWriter printing from DBase running under SoftPC

zben@umd5.umd.edu (Ben Cranston) (03/23/91)

Well, I've found the source of those "dictionary full" errors we were getting
when we tried to do Laserwriter output from DBase under Soft-PC.  The standard
Apple prep file creates a PostScript dictionary called "md", this is normally
done in such a way as to be permanently installed in the printer, but I've
modified this for my diversion stuff so md is created and destroyed for each
print file.

When Soft-PC does "PostScript" printing the data produced is embedded in a
standard Apple print wrapper.  At the point in the wrapper where Soft-PC's
data is inserted, the topmost dictionary in the "dictionary stack" is md.

The topmost dictionary in the dictionary stack is where "def" puts the keyword
and value being set.  When DBase outputs through Soft-PC the first "embedded"
data is DBase's own prep file, which defines yet ANOTHER set of primitives
that will later be used by the DBase data proper.  These defines are made with
the "def" operator and so go into md.

Now, here's the rub: the standard Apple prep defines md with a maximum size
of 270.  The standard Apple prep then proceeds to use 229 of those slots with
Apple-specific prep stuff.  The DBase prep attempts to use 96 more of these
slots to define DBase-specific stuff.  Unfortunately 229+96 = 325 > 270 so
one of DBase's "def" calls dies with a dictionary-full error.

Changing the prep file slightly to set md's size to 400 instead of 270 makes
the test file print OK, and it's a really small change compared with all the
other evil I've done to Apple's prep.  So it looks like a trivial change may
allow us to support Laserwriter output from DBase under Soft-PC.  We will try
to test this next week.

Another interesting correlary is that it would at least theoretically be
possible to find the string "/md 270 dict def md begin" in the standard
Apple "LaserPrep" file and patch it to "/md 400 dict def md begin" instead.
This would make DBase LaserWriter output under SoftPC work under a normal
(i.e. non-UOM-diverted) printing setup.

Ben Cranston <zben@ni.umd.edu>
Network Infrastructures Group
University of Maryland at College Park

-- 
Ben Cranston <zben@umd2.umd.edu>
A determined iconoclast, it would be better to assume the opinion expressed
above is the diametric OPPOSITE to that of the Warm and Fuzzy Network Group
of Egregious State University...

cy@dbase.A-T.COM (Cy Shuster) (04/03/91)

As an alternative, you can (as of last Friday) use dBASE IV RunTime
PLUS for Macintosh, which natively supports the LaserWriter without
the use of .PR2 drivers, and which also allows, just for fun, the
direct sending of PostScript commands with the infamous "???".
It is binary compatible with .DBOs created by PC or Unix dBASE IV,
and will share files in multiuser mode with PCs or Unix boxes,
for those systems and networks we support.

DISCLAIMER: I worked on the product. Email me for info.

--Cy--
cy@dbase.a-t.com