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 ..
Distiller file manipulation tools DISKTOOL.PS
*
PostScript
, Ghostscript or the Acrobat Distiller can easily access
printer
or host hard drives. This is a collection of Don Lancaster disk
file
access tutorials and utilities. Includes web site analysis examples.
PostScript web site analysis utility WEBSITAN.PS
*
Utterly
amazing utility converts Acrobat's Distiller into a super power
web site
analyzer!
Download as PostScript file; read as tutorial, then modify filenames.
Then
distill. Final results appear in the Distiller's generated .LOG file.
Font conversion tutorial and demo OLDFONTS.HTML *
Older
Adobe "printer only" fonts may be tricky to install into PC ATM.
Tutorial
shows
how to combine PFA2PFB.PS with readable .PFM files found in Type
on
call. Read as HTML document.
PostScript .PFA to .PFB font conversion utility PFA2PFB.PSL
*
Uses
Acrobat Distiller (or GhostScript or ps printer with disk) to convert
PC
.PFA
(hex-ascii) format font files to .PFB (binary) format font files.
Read
with editor or wp, then send to Distiller. PFB files are used internally.
PostScript .PFB to .PFA font conversion utility PFB2PFA.PSL
*
Uses
Acrobat Distiller (or GhostScript or ps printer with disk) to convert
PC
.PFB
(binary) format font files to .PFA (hex-ascii) format font files. Read
with editor or wp, then send to Distiller. PFA files can be modemed as
text.
PostScript Flutterwumper Utilities FLUTOOLS.PS *
A
set of flutterwumper tools that convert ordinary PostScript code
directly
intoa flutfile, or series of low level incremental X-Y-Z steps
needed
for low level motion control. Includes circles and typography.
Netscape News Uncompressor & Formatter NEWSFORM.PS *
Another
PostScript-as-language example. Reads the compressed Netscape
Newsgroup format,,and converts to HTML "hot link" code.
Read with
editor,
then send to Distiller, GhostScript, or PS device with 2-way comm.
Bionomial Goes Binary ONESWORD.HTML *
A
PostScript utility to generate all possible binary words of
length
"n"
having "k" ones in them. Use for magic sinewaves and exploration
of
the binomial theorm. Requires two way recordable com.
Linear Equation Solver LINEAREQ.PS
A
group of PosdtScript utilities and demos that use determinants to
solve high
order linear algebraic equations. Explicit examples shown
to
10x10. Includes linear phase digital filter design examples.
Improved colorizer utility COLORIZ2.PS
(*)
Revised
PostScript utility to simply upgrade existing gray tone
documents
so they print in continuous selectable color tints on
line and on screen, yet appear as original grays on a
B/W printer.
This
disgustingly elegant code also shows you how to write a
PostScript
program that writes its own PostScript programs!
Improved colorizer demo COLORZD2.PDF
(*)
A
one screen demo of the revised continuous colorizer tints
used
by coloriz2.ps. View on line with an Acrobat 3.0 reader
or
print to a color PostScript printer.
Don Lancaster's Gonzo
PostScript Utilities
This
is the combination pagemaking and illustration package
I
use for all of my work. It is powerful, flexible, and device independent.
But
not wysiwig. More details in my PostScript Beginner Stuff. PostScript
&
Bubble sort utility BUBLSORT.PS
(*)
Simple
stack-oriented utility that bubble sorts up to several
thousand
values. Read tutorial first as textfile, then test and
modify
as runnable PostScript code.
Insertion sort utility INSORT.PS (*)
Simple
stack-oriented utility that approximates an insertion sort
up
to several thousand values. Read tutorial first as textfile, then
test
and modify as runnable PostScript code.
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.
Further support on https://www.tinaja.com
Consulting services available via don@tinaja.com