Subject: 3 Formats and Conversions This section describes formats that can be converted to and from PostScript, and how to convert them. Encapsulated PostScript and Fonts have their own sections. Subject: 3.1 How can I convert PostScript to some other graphics format? Since PostScript is not just a picture-description language, but in fact a complete programming language, you will need a complete PostScript interpreter to convert or display a PostScript graphic. See the comp.sources.postscript FAQ for an index of all PostScript related programs. Try using GhostScript. Subject: 3.2 How can I convert DVI to PostScript? Use dvips. Subject: 3.3 How can I convert HP Laserjet language (PCL) to PostScript? Use lj2ps for simple PCL. Alternatively, another lj2ps, from psroff3.0, is a little more complete. hp2pbm can convert all of PCL4 (up to and including rasters, downloaded fonts and macros) into PostScript, G3 and any other PBM-supposed format. Subject: 3.4 How can I convert TeX PK format font to PostScript? Psroff3.0 contains programs that can convert TeX PK format or HP SFP format fonts into PostScript bitmap fonts along with rearranging encoding, etc. While bitmap bfonts scale poorly, this is sometimes of use in special circumstances. Subject: 3.5 How do I embed PostScript into troff? Most troffs can be ``coerced'' into including PostScript figures. The best approach is a configuration that takes EPS PostScript and can automatically scale it, or tell troff how big the picture is. Groff and DWB 3 have this built in. psfig is an add-on EPS inclusion handler that can add this capability to other versions of troff, provided that a compatible PostScript driver is used (Psroff 3.0 for ditroff or CAT troff, Transcript for ditroff). See the comp.text FAQ for more detail. Subject: 3.6 How do I embed PostScript into LaTeX or TeX? You should use an add-on program for seamless PostScript inclusion. Use psfig. If your LaTeX is simple, but your PostScript is fancy, try using LameTeX. If you need a good compromise, use pstricks. See the comp.text.tex FAQ. Subject: 3.7 How can I convert an image to PostScript? First determine what format your images are in. PBMPLUS will have converters for most image formats. To convert an image to PostScript in X windows, you can display the image on the screen, and grab it with xv, which can save the image in a PostScript file. A more general alternative in X windows would be to use the PPM, PGM and PBM utilities in the X11R4 and X11R5 distributions. Subject: 3.8 How can I convert ASCII text to PostScript? Unless your printer is smart about raw ASCII, you can't just send the ASCII to a PostScript printer, because the printer will attempt to interpret your ASCII file as PostScript code. You need a program which will wrap some PostScript code around your ASCII file. Try any of the following programs: asciiprint.ps, ato2pps, cz, ETSR, i2ps, lpp, lwf, POSTPRN, printer, psf, psfx80, PSR, ps2txt, pstext, swtext, text2ps, TranScript, spike.ps, enscript, nenscript, a2ps, asc2ps, ascii2ps, crossword.ps, double.ps, landscape.ps, numbered.ps, portrait.ps, or wide.ps. If you want to make something fancy, why not use a word processor? Most of them can ``include'' ASCII directly from a file and produce PostScript. Subject: 3.9 How can I convert PostScript to ASCII? In general, when you say ``I want to convert PostScript to ASCII'' what you really mean is ``I want to convert MacWrite (which makes PostScript output) to ASCII'' or ``I want to convert somebody's TeX document (which I have in PostScript) to ASCII''. Unfortunately, programs like these (if they're smart) do a lot of fancy stuff like kerning, which means that where they would normally execute the postscript command for ``print water fountain'' instead they execute the postscript command for ``print wat'' (move a little to get the spacing *just* right) ``print er'' (move a little to get the spacing *just* right) ``print foun'' (move a little to get the spacing *just* right) ``print tain'' (move a little to get the spacing *just* right) So if I write a program to look through a PostScript file for strings, like ps2ascii.pl, It can't tell where the words really end. Here my program would see 4 strings ``wat'' ``er'' ``foun'' ``tain'' And it doesn't see any difference between the spacing between ``found'' and ``tain'' (not a word break) and the spacing between ``er'' and ``foun'' (a real word break). The problem is that PostScript for text formatting is usually produced machine generated by a text formatter. A PostScript generator like dvips might have a special command like ``boop'' that differentiates between a real world break and a fake one. But every text formatter that generates PostScript has their own name for the ``boop'' command. So you really want a ``PostScript to ASCII converter for dvips output''. The only general solution I can see would be to redefine the show operator to print out the currentpoint for every letter being printed, like gs2asc, and then make up an ASCII page based on this by sticking ASCII characters where they go in a two-dimensional array. That would convert PostScript to ASCII ``formatted''. But even that wouldn't solve the problem, because special bitmap fonts and and standard fonts like Symbol don't always print a ``P'' when you say the letter ``P''. Sometimes they print the greek Pi symbol or a chess piece or a ZapfDingBat. Use ps2a, ps2ascii, ps2txt, ps2ascii.ps or ps2ascii.pl. Subject: 3.10 How do I convert between PFB, PFA, Mac, PFM, and AFM? Write or call Y and Y Software, listed in the fonts section as a vendor.