Subject Re: _pdriver does not work
From Mustansir Ghor <mustan31@hotmail.com>
Date Thu, 22 Feb 2018 13:21:50 -0500
Newsgroups dbase.getting-started

Dear Michael

WE thank you for valuable inputs . USB inputs with ESP/P2 sequence is kind of important topic looking at varoius printers we have in market. Dot Matrix, Serial Printer, Thermal printers (these have roll paper), Desk Jet, Laser Jet, Network Printers and many more.

However I refer to below 2 points

4. Use your printer driver disk to create your port if you are using usb. Most printers these days create their own virtual port. Take note if you plug your printer in a different port it wont work
5. once your port is set up, and you downloaded a generic print driver, you can send esc sequeces to it.

How and where do we check for this virtual port.

How do we indicate that we are sending ESC/P2 SEQUENCE to virtual USB port. I mean to say if it were parallel port we give command SET PRINTER TO LPT1

Best Regards
Mustansir

michael@itntgroup.com.au Wrote:

> Mustansir Ghor Wrote:
>
> > Dear Peter
> >
> > The length of my tractor feed paper between perforations is 4". So I was expecting when you give command eject after say 2 lines of printing that it goes to next perforation at 4". But here it went to 11" from from 1st perforation.
> >
> > Regards
> > Mustansir
> >
> > Peter Berglas Wrote:
> >
> > > Mervyn Bick Wrote:
> > >
> > > > On 2018-02-21 11:13 AM, Mustansir Ghor wrote:
> > > > > 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"
> > > >
> > > > If your printer understands Epson's ESC/P2 you can set the page length
> > > > in inches.  It will almost certainly understand ESC/P in which case you
> > > > can set the page length in lines.
> > > >
> > > >
> > > > The ESP/P instruction to set the page length in lines is
> > > >
> > > >      ESC C n   where n is between 1 and 127
> > > >
> > > > The ESC/P instruction to set the right margin
> > > >
> > > >      ESC Q n   where n is the number of characters
> > > >
> > > > The ESC/P instruction to set the left margin is
> > > >
> > > >      ESC I n   where n is the number of characters. Default is 1
> > > >
> > > > It's MANY years since I last had to send control codes to a printer so
> > > > the syntax below may need some work. :-(
> > > >
> > > > The default number of lines per inch is 6 so the following should set
> > > > the page length to 44 lines ie 4 inches.
> > > >
> > > >     set console off
> > > >     set print on
> > > >     ? chr(27)+'C44'
> > > >     ? chr(27)+'Q80'
> > > >     set print off
> > > >     set console on
> > > >
> > > >
> > > > If you haven't got the ESC/P manual for your printer, Google
> > > >
> > > >     epson esc/p manual
> > > >
> > > >
> > > >
> > > > Mervyn.
> > > >
> > > >
> > > >
> > > >
> > > My Epson LQ-850 is connected via parallel port, with no USB port available.  I recall somewhere in this site reading that ESC codes will not be transmitted via USB.
> > > What did you mean by "it stopped at A4 settings"?
> > > Peter
> >
>
> Hi Guys,
>
> Like Mervyn, I have done a mountain of work on Docket Printers and sending esc sequences for streaming receipts. Unfortunately Dbase falls over here in my view but depending what you want to do these are a few things you will need to know,
>
> 1. The printer must be ESC/Code compatible,
> 2. Papersize is actually set via the printer driver if you are printing via ? and ??
> 3. Mervyn was correct, use a generic driver, set the paper type in the preferences and printing defaults to B4(ISO) and paper feed to automatic. This will stop printing when you stop sending so you can control the length of print.
> 4. Use your printer driver disk to create your port if you are using usb. Most printers these days create their own virtual port. Take note if you plug your printer in a different port it wont work
> 5. once your port is set up, and you downloaded a generic print driver, you can send esc sequeces to it.
> 6. initialise the esc sequence with this little documented command ??? "{27}{64}"
> 7. This isnt a good way to print on multiuser environments because to effect esc sequences you need to send in multiple printjob/endprintjob commands and they will get confused amongst workstations unless you can write a locking routine.
> As an example, this piece of code with send a cut paper command if your printer has a esc sequence cutter but the process is the same to send a command through to the printer and it will work all the way to dbase 11 ( i havent tried it on 11.3)
>
>                               _pdriver = "windspool,Generic/Text"
>                               _peject = "NONE"
>                               _padvance = "FORMFEED"    
>                               PRINTJOB
>                               set printer on
>                               ???"{27}{64}"
>                               ???"{29}{86}{00}"
>                               set printer off
>                               endprintjob
>                               close printer
>                              
> I recreated all the docket style printing in the report generator which will work for all printers and is actually easier to control like Ken says but I find the end of page to be inconsistant between printers.
>
> Hope this helps for what you are doing.
>
> Cheers,
>
> Michael.
>