delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/07/10/21:53:02

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: Rod Whitby <list DOT cygwin AT rwhitby DOT net>
To: Rick Rankin <rick_rankin AT yahoo DOT com>
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: <m3snthbghg.fsf@a11375-rw.asc.corp.mot.com>
Lines: 49
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.2 (Molpe)
MIME-Version: 1.0

Rick Rankin <rick_rankin AT yahoo DOT com> 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, <GMT+9:30> --


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019