Using  Acrobat  Distiller  as  a
General  Purpose  PostScript  Computer
By Don Lancaster                                                                         
Version 2.2 May 25, 1997
Copyright c. 1997 by Don Lancaster and Synergetics, Box 809, Thatcher AZ, 85552
(520) 428-4073. synergetics@tinaja.com All commercial rights and all electronic media
rights are *fully* reserved. Linking welcome. Reposting is expressly forbidden.

Further support on https://www.tinaja.com
Consulting services available via don@tinaja.com


The Adobe Acrobat Distiller 3.0 can easily be used as a general purpose PostScript computer. As a surprisingly fast and an amazingly powerful interpreting one.

Distiller normally generates two documents: A .PDF file usable for later viewing or printing
of graphic output. And a .LOG file containing any "print" results from the input program,
along with status messages.

Distiller can also read any disk file in any format and write any disk file in any format. Once
written, these files can be used for port control or any computational purpose whatsoever.

As a simple example, say you want to find the sine of 35.4 degrees. Create the following
program in WordPad or another editor or word processor...

                                     %!
                                     35.4 sin = =   

Save the file as an ordinary text file with a .ps trailer. Drag and drop this file in the Adobe
Acrobat Distiller 3.0. The correct answer of 0.579281 should quickly pop up in the dialog
box. A later reading of the .LOG file will return this value, along with an expected warning
message that no .PDF file is produced.

The rule is that print or =  commands go to the .LOG file as text.. Marking commands such
as show, fill, stroke, or showpage go to the .PDF file as imaging actions. Writing or Reading commands work with your custom defined output or input disk files. There are lots of times
when using PostScript as language that you throw away the .PDF baby and drink the .LOG
file washwater instead.

Always start your file with the %! character pair! 
Do not end your file with a quit or a [d] when using Distiller!

One caution in using the log file: Distiller performs a flushfile on every newline character. So
you can see problems immediately as they occur. Any PostScript program that has lots of
print commands that include newline characters will (a) slow things down, and (b) cause a lot
of disk clatter. Thus, writing a special output file is faster and less demanding any time that
many newline characters are involved.

And a second .LOG file hassle: Long strings are truncated to 200 characters! The rest of the
string is replaced by three dots ... Use shorter strings, characters in a matrix, or your own special output file as workarounds. Long matrices or procs are properly reported.

Other nasty habits of log files are that the result will be a mix of your print commands and processing status and error messages. On an error, the log file stack dump is also truncated to 200 entries.

Distiller provides a rather bizarre twist on the pathforall operator. Pathforall will operate normally on any font properly installed into ATM. It will also operate uselessly but as expected on a Courier substitution for a non-Adobe or a mis-spelled font.

But pathforall will return a BOUNDING BOX (!) for a requested but uninstalled Adobe font. Watch this strange detail very closely.

On disk files, it is best to use the full "long form" path, starting with C: or whatever. It is also
best to always create new disk files, rather than overwriting or modifying existing ones. One
big gotcha here: Always use "\\" when you mean "\" in a PostScript filename string!

The GhostScript shareware can also be used as a general purpose PostScript computer. Its
advantages include lower cost, on-screen display, potential direct control, and potential user interactivity. Its disadvantages include its user viciousness, much slower speed, "feature lag",
and execution of certain procs in a nonofficial manner.

I have used PostScript as Language for many thousands of applications so far. And find its
device independence, object orientation, speed, and intuitive friendliness to be totally off scale.

Here are some current PostScript as Language distillable examples. Read these first as tutorial
text examples and then Distill them, Ghost them, or send them to a suitable PostScript device
having recordable two way comm.

These files all cana be found on the PostScript Library Shelf of my Guru's Lair at https://www.tinaja.com  ..


Selected major PostScript books by mainstream authors are stocked in depth by Synergetics

Two "must have" books are the PostScript Reference Manual "red" book and the PostScript
Tutorial & Cookbook
"blue" book. A special Whole Works package is also offered at a
significant cost savings way to get yourself PostScript literate in a big hurry.


Copyright c. 1997 by Don Lancaster and Synergetics, Box 809, Thatcher AZ, 85552
(520) 428-4073. synergetics@tinaja.com All commercial rights and all electronic media
rights are *fully* reserved. Linking welcome. Reposting is expressly forbidden.

Further support on https://www.tinaja.com
Consulting services available via don@tinaja.com