Problem printing on 12 inch form

Problem printing on 12 inch form

Postby cdmmaui » Wed Aug 03, 2011 2:36 am

Hello,

I am stil having a problem printing to a 12 inch form. The form is pre-printed so data must be printed in specific parts of the form and must be printed on two consecutive forms. The first page prints OK but the second page starts printing immediately following the last data from the first page which leads me to believe the PrnSetSize( <Width>, <Length> ) does not work. I am using FWH 8.10. Here is the source code, I would be truely grateful if someone had a solution to this problem.

// Init...
nWid := ROUND( 8.5 * 254, 0) // convert to inches to millimeters
nLen := ROUND( 11 * 254, 0)
PrnSetSize(nWid, nLen )

PRINT oPrinter NAME "Form 12" FROM USER PREVIEW

if empty( oPrinter:hDC )
return nil
endif

DEFINE FONT oFont1 NAME "Arial" SIZE 0,-10 OF oPrinter
DEFINE FONT oFont2 NAME "Arial" SIZE 0,-14 OF oPrinter
DEFINE FONT oFont3 NAME "Arial" SIZE 0,-10 OF oPrinter
DEFINE FONT oFont4 NAME "Arial" SIZE 0,-10 OF oPrinter

// Init...
Mwidth = oPrinter:nHorzRes()
Mheight = oPrinter:nVertRes()
Mrow = 0
M_col = 0
nCol = 0
nHgt = oPrinter:GetTextHeight("X", oFont1 )
nCopy = 2

FOR nPrt=1 TO nCopy

/* Start Printing Page */
PAGE

// Init...
Mrow = 0
M_col = 0

// Print data
_IntlAwb( oPrinter, "pfx", @Mrow, @M_col )
M_dat = 'XXX'
oPrinter:Say( Mrow, M_col, M_dat, oFont1 )

// Print more data for length of 12 inch form...

// Bottom of form
_IntlAwb( oPrinter, "awb3" , @Mrow, @M_col )
M_dat = 'XXXX'
oPrinter:Say( Mrow, M_col, M_dat, oFont2 )

// End of Page ------------------------- >>> Should this form feed to next page???
ENDPAGE
NEXT nPrt

ENDPRINT

// Return to letter size paper
nWid := ROUND( 8.5 * 254, 0)
nLen := ROUND( 11 * 254, 0)
PrnSetSize(nWid, nLen )

RELEASE FONT oFont1
RELEASE FONT oFont2
RELEASE FONT oFont3
RELEASE FONT oFont4

RETURN nil

//-----------------------------------------------------------------------------
FUNC _IntlAwb( oPrinter, cField, nRow, nCol )

local nR1 := 0 , ;
nC1 := 0 , ;
nWi := oPrinter:nHorzRes() , ;
nHe := oPrinter:nVertRes()

SysRefresh()
SELECT intlawb
GO TOP

cR1 := cField + "R"
cC1 := cField + "C"
IF TYPE( cR1 ) <> "U"
nR1 := ROUND( nHe * (( intlawb->&cR1 )/100), 1 )
ENDIF
IF TYPE( cC1 ) <> "U"
nC1 := ROUND( nWi * (( intlawb->&cC1 )/100), 1 )
ENDIF

IF (nR1>0.0)
nRow := nR1
ENDIF
IF (nC1>0.0)
nCol := nC1
ENDIF
SysRefresh()

RETURN (.T.)
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Problem printing on 12 inch form

Postby Enrico Maria Giordano » Wed Aug 03, 2011 9:55 pm

cdmmaui wrote: // End of Page ------------------------- >>> Should this form feed to next page???
ENDPAGE


Definitely yes. It seems a bug of the printer driver. Check if there is a newer release.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem printing on 12 inch form

Postby kok joek hoa » Thu Aug 04, 2011 7:23 am

Dear cdmmaui,

try this way :


// Init...
nWid := ROUND( 8.5 * 254, 0) // convert to inches to millimeters
nLen := ROUND( 12 * 254, 0)

PRINT oPrinter NAME "Form 12" FROM USER PREVIEW

if empty( oPrinter:hDC )
return nil
endif

PrnSetSize(nWid, nLen )
oPrinter:Rebuild()



Regards,
Kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 60 guests