Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!usc!orion.oac.uci.edu!sfrank From: sfrank@orion.oac.uci.edu (Steven Frank) Newsgroups: comp.windows.ms Subject: Re: Printing PostScript to a File: ^D problem? Message-ID: <27A85199.8428@orion.oac.uci.edu> Date: 31 Jan 91 17:19:21 GMT References: <1991Jan21.181243.6378@amd.com> <1991Jan31.172019.4248@csc.anu.edu.au> Organization: University of California, Irvine Lines: 46 In article <1991Jan31.172019.4248@csc.anu.edu.au> pwo900@csc.anu.edu.au writes: >In article <1991Jan21.181243.6378@amd.com>, indra@brahms.amd.com (Indra Singhal) writes: >> I normally print my documents to a file, carry the floppy to work and >> shoot the postscript out to a printer. >> >> All documents that I generate postscript for from Windows, has a leading >> Ctrl-D character. This 1st character blows away the printers I sent the >> file to with the: binary file encountered error. >> >> So far I have editted the file to delete the 1st character and then all >> works well... anyone outthere who has a better solution? > >I have a similar problem. I have even tried the PSCRIPT.DRV upgrade available >through cica.cica.indiana.edu, but with the same results. > >Does anyone know of a patch to remove the troublesome ^D?> > /* Filter for Micrografx PostScript files. The goal is to remove a ^D% as the two characters and insert %! to indicate PS, and to remove the trailing ^D at the end of the file */ #include #include main() I save the PostScript to a file, run the file through the following filter, and then save the output to the printer. A C compiler and some knowledge of how to use filters and send files directly to the printer is needed to use this method. char c; int i; for (i = 0; i < 2; i++) getchar(); /* discards initial ^D%*/ putchar('%'); putchar('!'); while ((c = getchar()) != EOF){ if (c != 4) /* ^D = 4 */ putchar(c); } }