oPrn:SetSize(nWidth,nHeigt)

oPrn:SetSize(nWidth,nHeigt)

Postby Armando » Fri May 11, 2007 4: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
User avatar
Armando
 
Posts: 3228
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Postby Antonio Linares » Fri May 11, 2007 4:24 pm

Armando,

Please do it this way:

PrnSetSize( 650, 250 )

PRINTER oPrt Preview
...
ENDPRINT
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42100
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Armando » Fri May 11, 2007 5: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
User avatar
Armando
 
Posts: 3228
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Postby Antonio Linares » Fri May 11, 2007 5: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42100
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Armando » Fri May 11, 2007 5: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
User avatar
Armando
 
Posts: 3228
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Postby James Bott » Fri May 11, 2007 6:14 pm

Armando,

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

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Armando » Fri May 11, 2007 7: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
User avatar
Armando
 
Posts: 3228
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Postby James Bott » 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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Armando » Sat May 12, 2007 2: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
User avatar
Armando
 
Posts: 3228
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Postby Armando » Sat May 12, 2007 5:49 pm

Mr. Antonio:

This is a little sample of my problem
Code: Select all  Expand view
  1.  
  2. #Include "FiveWin.ch"
  3. FUNCTION AppLbl1a()
  4.      LOCAL oPrt,oFont,nVez
  5.  
  6.      PrnSetSize( 650, 250 )
  7.      PRINTER oPrt PREVIEW
  8.  
  9.      DEFINE FONT oFont NAME "ARIAL" SIZE 0,-14 OF oPrt
  10.  
  11.           MsgInfo(oPrt:nHorzSize())
  12.           MsgInfo(oPrt:nVertSize())
  13.  
  14.           oPrt:SetSize(550,150)   // This no modify the size, why ?
  15.  
  16.           MsgInfo(oPrt:nHorzSize())
  17.           MsgInfo(oPrt:nVertSize())
  18.  
  19.           FOR nVez := 1 TO 10
  20.     PAGE
  21.          oPrt:SAY(50,40,"Printing ..." + STR(nVez),oFont)
  22.     ENDPAGE
  23.           NEXT
  24.  
  25.      ENDPRINTER
  26. RETURN(NIL)
  27.  

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
User avatar
Armando
 
Posts: 3228
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Postby Antonio Linares » Sun May 13, 2007 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42100
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Armando » Sun May 13, 2007 1: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
User avatar
Armando
 
Posts: 3228
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 89 guests