Hi there, While I was playing with PostScript a few weeks ago, I found out that it is possible to list the names of the keywords in PostScript's dictionaries. Because we're going to swich from an Apple LaserWriter to an Agfa P3400PS Laser Printer, I thought it might be nice to have a way to compare the internal dictionaries of these printers. This resulted in a recursive PostScript program, systemdict.ps, that lists the total contents of the printer's dicts. The output is as follows (in regular expression syntax): level keyword type value where: level = (. )* keyword = type = "(" ((typeId ( access | none )) | none) ")" typeId = (array|boolean|dict|file|fontId|integer|mark|name| null|operator|packedarray|real|save|string) access = (","(r|-)(w|-)(x|-)) value = (( "=" ) | none ) none = "" which means: level gives the level of the dictionary: "" means the upper level ". " means one level below the upper level ". . " means two levels below the upper level and so on Each time a dictionary is encountered the program descends a level and that dictionary is then listed. An empty line indicates that the program is ascending one level. For instance, a part of the systemdict might look like: type (operator) % upper level (systemdict) userdict (dict,rw-) % userdict is encountered . #copies (integer) = 1 % #copies is a keyword in userdict . $IdleTimeDict (dict,rw-) % a new dict is encountered . . ROMnames (array,r--) % an entry in $IdleTimeDict % empty line: ascending one level . LocalDict (dict,rw-) % LocalDict is a keyword in userdict.. . . Dlen (integer) = 24 % .. which is again a dict % empty line: ascending . start (packedarray,r-x) % a keyword in userdict % empty line: back to systemdict usertime (operator) % a keyword in systemdict version (string,r--) = 38.0 % ... In the latter example the keywords are: type, userdict, #copies, $IdleTimeDict, ROMnames, LocalDict, Dlen, start, usertime and version. The types are: operator, dict, integer, array, packedarray and string. The accesses are: r = read w = write x = execute so rw- means: read access, write access, not executable If the keyword's value is of the type integer, string, name, boolean or real, then the value of the keyword is listed if the ascii representation doesn't exeed 19 characters. If it exeeds 19 characters then the representation is clipped, which is indicated by three dots. For instance: Notice (string,r--) = Helvetica is a ... The font dictionaries, located in the FontDictionary, contain a dictionary called CharStrings. See the Red Book page 92 for a description of this dictionary. The contents of these dictionaries is not listed (it would produce many many pages of identical information). Instead, three dots indicate that there is more... For instance: FontDirectory (dict,r--) . Courier (dict,r--) . . CharStrings (dict,r--) . . . ... . . Encoding (array,r--) . . FID (fontId) and so on Every dictionary is first sorted in alphabetically ascending order by the procedure qsort, written August 31, 1989 by Scott Hemphill, who posted his routine to comp.lang.postscript a while ago as an addition to the PostScript toolkit. Line 265 in the file systemdict.ps is: /DictName (systemdict) def The string systemdict can be changed to anything else that results in a dictionary on the stack. For instance: /DictName (userdict) def or: /DictName (systemdict /statusdict get) def If you do so, be sure to modify line 74 (starting level information) as well. If you have any comments or if you encounter any bugs, please let me know. Jos de Bruijne Philips Research Laboratories Eindhoven, The Netherlands Email: debruyne@prles3.prl.philips.nl