Subject Re: _pdriver does not work
From Peter Berglas <phb2020@hotmail.com>
Date Tue, 20 Feb 2018 13:37:17 -0500
Newsgroups dbase.getting-started

Mustansir Ghor Wrote:

> Dear Peter
>
> This subject interest me. Although I am rewritting my code in dbase11.3 , I have a receipt printing using DOS printer Epson LQ 690 which is tractor feed multi part paper of 4" length. It is possible to give little example how are you sending streaming code to printer in dBase11.3. I mean PAGE EJECT and other control codes.
>
> When I tried with PRINTJOB and ENDPRINTJOB , the first streaming did not print, on second streaming, 1st come out, and so on , last streaming did not print. Again although paper setting for tractor is 4", on  PAGE EJECT it feeds 11" (All this is on USB cable). Are you using same or LPT1.
>
> Besides using report engine, one advantage for streaming out is (especially for DOS printer) that it prints fast without resolution problem.
>
> Best Regards
> Mustansir
>
>
> Peter Berglas Wrote:
>
> > Ken Mayer Wrote:
> >
> > > On 1/31/2018 7:04 AM, Peter Berglas wrote:
> > > > I have sent prior requests for help in this matter, but no matter what I try, I can't get _pdriver to change.  Using Windows 10.  Please take a look at the file below.  In dBase Plus 11, _pdriver does not send the streaming to the appropriate paper location in my Okidata printer.  In Visual dBase 7.01, I have no problem.  I have been using vdb for years and upgraded to Plus 11 early in 2017.  This is the only problem I am having and I cannot figure out what to do.
> > > > I have even tried a small batch file that changes the Windows default printer, but this does not come into effect until I close dBase and then restart it.
> > > > I have tried _app.printer also to no avail.
> > > > Please note that these are not reports, but streaming.
> > > > I look forward to some help.
> > >
> > > I hate to tell you this, but the old streaming code for printing was
> > > written for DOS, and doesn't translate well to Windows. If you cannot
> > > get _PDRIVER to work (and most of us are not really going to try), you
> > > are going to need to learn to use the dBASE report engine ... it's not
> > > that bad, there is some help in my tutorial (see below), and I have
> > > written a book on dBASE reports that can be helpful.
> > >
> > > Ken
> > >
> > > --
> > > *Ken Mayer*
> > > Ken's dBASE Page: http://www.goldenstag.net/dbase
> > > The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
> > > dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
> > > dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
> >
> > Hi Ken,
> > I hate to tell you this, but even though the old streaming code for printing may have been written for DOS, and may not translate well to Windows, with a bit of work I was able to accomplish the transition without rewriting all my streaming code.  Most of us might not try, but I did.
> > I used :   _app.printer.printerName="Okipage 10ex Manual Feed"
> > My problem was that I was using _app.printer.printerName="WINSPOOL,Okipage 10ex Manual Feed"
> > By trail and error using the Command window, I found out that the "WINSPOOL" should not be included.  I think this was mentioned elsewhere.  Did not need chooseprinter().
> > I hope this helps others too.
> > Peter
> >
>
I have been using an Epson LQ-850 dot matrix printer for over 20 years to print post card reminders which are 4" high and 6" wide.
The simple code I use is listed below.  
First the post card must be entered as an option within Windows under "Printer Server Properties", where you can specify size of the card.
_padvance needs to be "Linefeeds" which is explained in the Language Reference.

You can also use the LABEL DESIGNER within dBase.  The specific printer code is as follows:

   with (this.printer)
      printerSource = 2             // Specific
      duplex = 1        // None
      orientation = 1            // Portrait
      printerName = "Epson LQ-850"
      paperSource = 259   //Tractor Feed
      paperSize = 129       //Post Card
      resolution = 4            // High
      color = 1                    // Monochrome
      trueTypeFonts = 2   // Download
   endwith

FOR STREAMING:
use whatever.dbf
go top
_pdriver="WINSPOOL,Epson LQ-850"
// also above line can be changed to:
//_app.printer.printerName="Epson LQ-850"
//or Chooseprinter()
_padvance="LINEFEEDS"
_plength=24
set console off
set printer on
do while not eof()
   set prow to 8
   ? upper(trim(title))+" "+upper(trim(fname))+" "+upper(trim(lname))
   ? upper(trim(addr1))
   ? upper(trim(city))+", "+ST+"   "+ZIP
   eject
   skip
enddo
set printer off
set console on
use

Hope that this helps you.