Subject Re: _pdriver does not work
From Mustansir Ghor <mustan31@hotmail.com>
Date Wed, 21 Feb 2018 04:13:33 -0500
Newsgroups dbase.getting-started
Attachment(s) Capture 2.PNGCapture 3.PNGghor.rep

Dear Peter

Thank you for example given. It is working all well. But main problem still persists. It does recognize paper size. I wonder, are you using USB port or parallel port (LPT!). I am testing on USB port.

I went further to try to set printer setting ( Devices & Printers) for custom paper size of H= 4" , W= 8.5" named it as bchc and used this in tractor feed.  When I did Test print (from Windows) , it worked fine and Test print came out on 4" tractor feed paper and tear off position was correct.

So now I opened report engine and set printer to EPSON LQ-690 ESC/P2, made page template to H = 4" and W = 8.5" , when it printed it did not work and it stopped at A4 settings.

I then thought  of changing paper size on printer property and select bchc the name that I had set for paper size  in Windows printer, however this name did not appear.

Please can anybody guide on this subject as how to make dBase 11.3 understand that for the printer chosen, its paper size is H= 4" and w=8.5"

Attached are images for Windows printer settings, Report Enginer printer settings, and report file.

Best Regards
Mustasnsir


Peter Berglas Wrote:

> 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.
>