Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com From: Rod Whitby To: Rick Rankin Cc: cygwin AT sourceware DOT cygnus DOT com Subject: Re: Providing a working "lp" in cygwin? References: <20000710224923 DOT 3636 DOT qmail AT web805 DOT mail DOT yahoo DOT com> Date: 11 Jul 2000 11:00:51 +0930 In-Reply-To: Rick Rankin's message of "Mon, 10 Jul 2000 15:49:23 -0700 (PDT)" Message-ID: Lines: 49 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.2 (Molpe) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Rick Rankin writes: > FWIW, I've attached the "C" source to a very simple lpr filter I wrote a year > or more ago. I use it with Emacs, enscript, groff, et. al. Use it as you see > fit. Thanks Rick - that was just what I was looking for today :-) Does anyone know how to make it print A4 instead of Letter ? I tried the following, but it didn't work. *** /cygdrive/c/TEMP/T0001127 Tue Jul 11 10:56:45 2000 --- lpr.c Tue Jul 11 10:49:55 2000 *************** *** 109,114 **** --- 109,116 ---- FILE * inputFile; int i; int exitCode = 0; + long size; + DEVMODE *dm1; if ((envPtr = getenv("PRINTER")) != NULL) { *************** *** 136,141 **** --- 138,155 ---- exitCode = error(1, "can't open '%s' for writing", deviceName); else { + + size = DocumentProperties(NULL, deviceHandle, NULL, NULL, NULL, 0); + + dm1 = (DEVMODE *)malloc(size); + + DocumentProperties(NULL, deviceHandle, NULL, dm1, NULL, DM_OUT_BUFFER); + + dm1->dmPaperSize = DMPAPER_A4; + dm1->dmFields |= DM_PAPERSIZE; + + DocumentProperties(NULL, deviceHandle, NULL, NULL, dm1, DM_IN_BUFFER); + if (optind >= argc) exitCode = lpr(stdin, "stdin"); else -- -- Rod Whitby, Snr Staff Engr, Electronic Design Automation -- -- Motorola Australia Software Centre - Adelaide, Australia -- -- Phone: +61 8 8203 3526, Fax: +61 8 8203 3501, -- -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com