Page 1 of 1

using DCPRINT ON to oPrinter AND XbpPrinter

Posted: Tue Jun 25, 2019 7:20 am
by digitsoft
hello Roger
How to use these methods
:status()
: paperBins ()
: printerStatus ()
: paperSize ()
: getHDC ()
: resolutions ()
: forms ()
from XbpPrinter ()
when using DCPRINT ON to oPrinter
oPrinter: status ()
oPrinter: paperBins ()
oPrinter: printerStatus ()
oPrinter: paperSize ()
oPrinter: getHDC ()
oPrinter: resolutions ()
oPrinter: forms ()
they do not work

Re: using DCPRINT ON to oPrinter AND XbpPrinter

Posted: Tue Jun 25, 2019 7:45 am
by rdonnay
The :oDC iVar contains a pointer to the XbpPrinter() object.

WTF oPrinter:oDC:paperbins()

Re: using DCPRINT ON to oPrinter AND XbpPrinter

Posted: Tue Jun 25, 2019 7:59 am
by digitsoft
Hola Roger
It doesn't work
rdonnay wrote:The :oDC iVar contains a pointer to the XbpPrinter() object.

WTF oPrinter:oDC:paperbins()

Re: using DCPRINT ON to oPrinter AND XbpPrinter

Posted: Tue Jun 25, 2019 8:19 am
by rdonnay
Show me your code.

Re: using DCPRINT ON to oPrinter AND XbpPrinter

Posted: Tue Jun 25, 2019 8:43 am
by digitsoft
FUNCTION MAIN( )
local I, nRow := 0, aPageSize
local oPrinter, oPS, cPuertoPrinter := "EPSON FX-2190 ESC/P" &&'CITIZEN CT-S310II'

local ESC := "\u001B"
local GS := "\u001D"
local InitializePrinter := ESC + "@"
local BoldOn := ESC + "E" + "\u0001"
local BoldOff := ESC + "E" + "\0"
local DoubleOn := GS + "!" + "\u0011" // 2x sized text (double-high + double-wide)
local DoubleOff := GS + "!" + "\0"

BEGIN SEQUENCE


DCPRINT ON TO oPrinter ;
NAME cPuertoPrinter ;
PREVIEW ;
SIZE 66, 80 ;
FONT '9.Arial' ; && PAGESIZE ; NOSCALE ; && UNITS GRA_PU_LOMETRIC ; FORMSIZE XBPPRN_FORM_QUARTO ;
NOSTOP ;
HIDE

IF Valtype(oPrinter) # 'O' .OR. !oPrinter:lActive
BREAK
END if

dcqout 'status: ',oPrinter:oDC:Status()
dcqout 'status: ',oPrinter:oDC:printerStatus()
dcqout 'paperBins:',oPrinter:oDC:paperBins()
dcqout 'paperSize:',oPrinter:paperSize()
dcqout 'getHDC:',oPrinter:oDC:getHDC()
dcqout 'resolutions:',oPrinter:oDC:resolutions()
dcqout 'forms:',oPrinter:oDC:forms()


nRow := 0
for I := 1 TO 60
@ nRow++,01.0 DCPRINT SAY 'This is line ' + Alltrim(Str(nRow)) PRINTER oPrinter
if nRow > 33
DCPRINT EJECT PRINTER oPrinter
nRow := 1
END if
next I

DCPRINT OFF
return
rdonnay wrote:Show me your code.

Re: using DCPRINT ON to oPrinter AND XbpPrinter

Posted: Tue Jun 25, 2019 10:31 am
by rdonnay
There is no XbpPrinter() object when using PREVIEW.

This uses the Presentation Space object of the XbpDialog() class.

Therefore :oDC will be a NIL.

What are you trying to do?

Re: using DCPRINT ON to oPrinter AND XbpPrinter

Posted: Tue Jun 25, 2019 10:54 am
by digitsoft
The Understood
I want to use DCPRINT ON to print on Page 9 ½ x 5 ½ or Page 9 ½ x 11
but when I use DCPRINT EJECT I skip the whole page if I use Page 9 ½ x 5 ½
I currently do it using Command CHR emulating DOS


quote="rdonnay"]There is no XbpPrinter() object when using PREVIEW.

This uses the Presentation Space object of the XbpDialog() class.

Therefore :oDC will be a NIL.

What are you trying to do?[/quote]

Re: using DCPRINT ON to oPrinter AND XbpPrinter

Posted: Tue Jun 25, 2019 5:28 pm
by rdonnay
but when I use DCPRINT EJECT I skip the whole page if I use Page 9 ½ x 5 ½
You need to use DCPRINT FORMSIZE <nForm> where <nForm> is a define from XbpDev.ch.

Re: using DCPRINT ON to oPrinter AND XbpPrinter

Posted: Wed Jun 26, 2019 5:44 am
by digitsoft
Thanks Roger


rdonnay wrote:
but when I use DCPRINT EJECT I skip the whole page if I use Page 9 ½ x 5 ½
You need to use DCPRINT FORMSIZE <nForm> where <nForm> is a define from XbpDev.ch.