FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour oPrn:SetSize(nWidth,nHeigt)
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
oPrn:SetSize(nWidth,nHeigt)
Posted: Fri May 11, 2007 04:15 PM

Mr. Antonio Linares:

Why oPrn:SetSize(nWidth,nHeight) it does not work?

I tried with oPrn:SETSIZE(650,250) but it does not change the size of the page

PRINTER oPrt Preview
oPrn:SetSize(650,250) // I need 6.5cms x 2.5cms

Best regards and many thanks

Armando

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
oPrn:SetSize(nWidth,nHeigt)
Posted: Fri May 11, 2007 04:24 PM

Armando,

Please do it this way:

PrnSetSize( 650, 250 )

PRINTER oPrt Preview
...
ENDPRINT

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
oPrn:SetSize(nWidth,nHeigt)
Posted: Fri May 11, 2007 05:03 PM

Mr. Antonio:

No way, this is my source code

PrnSetSize( 650, 250 )
PRINTER oPrt Preview

DEFINE FONT oFnt1 NAME "ARIAL" SIZE 0,-6 OF oPrt BOLD
DEFINE FONT oFnt2 NAME "ARIAL" SIZE 0,-8 OF oPrt BOLD
DEFINE FONT oFnt3 NAME "ARIAL" SIZE 0,-9 OF oPrt BOLD

oTxtFile = TTxtFile():New(cFile,0)
oTxtFile:GOTOP()

DO WHILE ! oTxtFile:lEOF()
cLinea := oTxtFile:ReadLine()
cCod := LEFT(cLinea,11)
cEst := SUBSTR(cLinea,013,10)
cSku := SUBSTR(cLinea,069,04)
cLin := SUBSTR(cLinea,073,02)
cSln := SUBSTR(cLinea,075,04)
cPre := SUBSTR(cLinea,113,07)
cTxt := SUBSTR(cLinea,123,12)

cSku := STRZERO(VAL(cSku),4)
cSku += "-" + STRZERO(VAL(cLin),4)
cSku += "-" + STRZERO(VAL(cSln),4)
cPre := "$" + ALLTRIM(TRANSFORM((VAL(cPre) / 100),"99,999.99"))

PAGE
nMrgSup := 00
nMrgIzq := 15
@ nMrgSup,nMrgIzq UPCA cCod OF oPrt BANNER SIZE .7
nMrgSup += 120
oPrt:SAY(nMrgSup,nMrgIzq+900,cPre,oFnt2)
nMrgSup += 70
@ nMrgSup,nMrgIzq + 750 UPCA cCod OF oPrt BANNER SIZE .5
nMrgSup += 60
oPrt:SAY(nMrgSup,nMrgIzq,cSku,oFnt1)
nMrgSup += 50
oPrt:SAY(nMrgSup,nMrgIzq,cEst,oFnt1)
nMrgSup += 15
oPrt:SAY(nMrgSup,nMrgIzq+300,cPre,oFnt2)
nMrgSup += 55
oPrt:SAY(nMrgSup,nMrgIzq,cTxt,oFnt1)
oPrt:SAY(nMrgSup,nMrgIzq+850,cTxt,oFnt1)
ENDPAGE
oTxtFile:Advance()
ENDDO
ENDPRINT
oTxtFile:END()

Regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
oPrn:SetSize(nWidth,nHeigt)
Posted: Fri May 11, 2007 05:15 PM

Armando,

Are you going to print labels ? If yes, then just calculate a new label position from your code

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
oPrn:SetSize(nWidth,nHeigt)
Posted: Fri May 11, 2007 05:59 PM

Mr. Antonio:

Yes, I have to print labels.

The labels are in roll, continuous form, then that is my problem.

The TPrinter class use letter size by default.

Could you help me ?

Best regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
oPrn:SetSize(nWidth,nHeigt)
Posted: Fri May 11, 2007 06:14 PM

Armando,

Have you looked at FWH\SAMPLES\LABELS? This may help.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
oPrn:SetSize(nWidth,nHeigt)
Posted: Fri May 11, 2007 07:58 PM

James:

Thanks for your reply.

I have seen the examples but it seems that all are for printing labels in letter size pages and I have to print in a special size and the code oPrn:SETSIZE(nWidth,nHeigt) does not work.

Best regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
oPrn:SetSize(nWidth,nHeigt)
Posted: Fri May 11, 2007 10:52 PM

Armando,

I don't know if this will help, but here is a copy of an old message about label printing.

You might also try searching the forum for "label."

James


6/30/2006 11:36 AM

I use the Dymo Turbo 330 and run it from within a program. Here is the code I use:

FUNCTION ShipLabel
// Declare variables
LOCAL oDbf, nRow := 0

PRINT oPrn NAME "Report Printing" TO "DYMO LabelWriter 330 Turbo" // FROM USER

// Define the fonts to be used
DEFINE FONT oFnorm NAME "Courier New" SIZE 0, - 12 OF oPrn
DEFINE FONT oFbold NAME "Courier New" SIZE 0, - 12 BOLD OF oPrn
nRsp := oPrn:nVertRes() / 20 // Number of rows
nCsp := oPrn:nHorzRes() / 40 // Number of columns
oPrn:SetLandscape( )
nRow := 2 * nRsp

PAGE
oPrn:Say( nRow, 10 * nCsp, "MasterLink Software", oFbold )
nRow += nRsp
oPrn:Say( nRow, 15 * nCsp, "PO Box 740", oFbold )
nRow += nRsp
oPrn:Say( nRow, 5 * nCsp, "Trabuco Canyon, CA 92678-0740", oFbold)
nRow += nRsp
oPrn:Say( nRow, 2 * nCsp, "_________", oFnorm )
nRow += 2 * nRsp
oPrn:Say( nRow, 2 * nCsp, oCli:company, oFnorm )
nRow += nRsp
oPrn:Say( nRow, 2 * nCsp, oCli:street, oFnorm )
nRow += nRsp
oPrn:Say( nRow, 2 * nCsp, TRIM(oCli:city) + ", " + oCli:state + " " + oCli:zipcode, oFnorm )
ENDPAGE
ENDPRINT
oFnorm:end()
oFbold:end()

RETURN NIL

The same, I suspect, would work with the 400. I hope this helps.

Tim


Tim Stone

www.MasterLinkSoftware.com

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
oPrn:SetSize(nWidth,nHeigt)
Posted: Sat May 12, 2007 02:26 AM

Thanks James, I will

Regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
oPrn:SetSize(nWidth,nHeigt)
Posted: Sat May 12, 2007 05:49 PM
Mr. Antonio:

This is a little sample of my problem
Code (fw): Select all Collapse
<ol><li style="" class="li1"> </li><li style="" class="li2">#Include "FiveWin.ch"</li><li style="" class="li1">FUNCTION AppLbl1a()</li><li style="" class="li2">     LOCAL oPrt,oFont,nVez</li><li style="" class="li1"> </li><li style="" class="li2">     PrnSetSize( 650, 250 )</li><li style="" class="li1">     PRINTER oPrt PREVIEW</li><li style="" class="li2"> </li><li style="" class="li1">     DEFINE FONT oFont NAME "ARIAL" SIZE 0,-14 OF oPrt</li><li style="" class="li2"> </li><li style="" class="li1">          MsgInfo(oPrt:nHorzSize())</li><li style="" class="li2">          MsgInfo(oPrt:nVertSize())</li><li style="" class="li1"> </li><li style="" class="li2">          oPrt:SetSize(550,150)   // This no modify the size, why ?</li><li style="" class="li1"> </li><li style="" class="li2">          MsgInfo(oPrt:nHorzSize())</li><li style="" class="li1">          MsgInfo(oPrt:nVertSize())</li><li style="" class="li2"> </li><li style="" class="li1">          FOR nVez := 1 TO 10</li><li style="" class="li2">    PAGE</li><li style="" class="li1">         oPrt:SAY(50,40,"Printing ..." + STR(nVez),oFont)</li><li style="" class="li2">    ENDPAGE</li><li style="" class="li1">          NEXT</li><li style="" class="li2"> </li><li style="" class="li1">     ENDPRINTER</li><li style="" class="li2">RETURN(NIL)</li><li style="" class="li1"> </li></ol>

What is wrong ?, I hope you can help me pls.

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
oPrn:SetSize(nWidth,nHeigt)
Posted: Sun May 13, 2007 07:12 AM

> oPrt:SetSize(550,150) // This no modify the size, why ?

We don't know it. It should work

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
oPrn:SetSize(nWidth,nHeigt)
Posted: Sun May 13, 2007 01:31 PM

Mr. Antonio:

Did you test my sample , works it fine to you

Could you make an exe file from my sample and send it to me

Best regards and tnks.

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero

Continue the discussion