there is something not working
in my program I have this result
Let me start by saying
I don't use xoffset and yoffset
and the values for the HP laserjet professional P1606dn printer are 94 and 94
on another test I made now the same not use
xoffset and yoffset
and the values for the HP laserjet professional P1606dn printer are 94 and 94
the result is different
this is the test
#include "fivewin.ch"
Function test()
local oPrn
local cDescRep := "Trying xoffset and yOffset"
local aPrn := GetPrinters()
//-------------------------------------------------------//
local nWidth := 20 +0.2
local nHeight := 7.80 +0.5
local nGutter := 0.5
local nRows := 3
local nCols := 1
local nPrintHeight := nRows * ( nHeight + nGutter ) - nGutter
local nPrintWidth := nCols * ( nWidth + nGutter ) - nGutter
local nTopMargin := 0
local nLeftMargin := 0
local nTop := nTopMargin
local nLeft := nLeftMargin
local nPageH := 29.7 //A4
local nPageW := 21
//-------------------------------------------------------//
IF nTopMargin= 0
nTopMargin := ( nPageH - nPrintHeight ) / 2
nLeftMargin := ( nPageW - nPrintWidth ) / 2
ENDIF
nTop := nTopMargin
nLeft := nLeftMargin
xbrowser aPrn
oPrn:=PrintBegin(cDescRep,.F.,.t.,,.T.)
? oPrn:nYoffset,oPrn:nXoffset // give me 94,94
* oPrn:nYoffset :=0
* oPrn:nXoffset :=0
PageBegin()
//first Box
PrintBox(nTop, nLeft, nWidth, nHeight,0,0,20,1.2,oPrn)
//second Box
PrintBox(nTop, nLeft, nWidth, nHeight,1.2,0,20,7.8,oPrn)
PageEnd()
PrintEnd()
return nil
//---------------------------------------------------------------------//
Function PrintBox(nRow, nCol, nWidth, nHeight,nX,nY,nLar,nAlt,oPrn)
local oFnt
local cFontname:= "Arial"
local nFontSize:= 12
local lBold:= .f.
local lItalic:= .f.
local X,Y,Z,K
local lBordo:= .t.
local nColorBordo:= CLR_BLACK
local nSizeBordo:=0.01
local nBackcolor :=CLR_WHITE
local cText:=""
local nColorFont:= CLR_BLACK
local nAlignOriz:= 1
local nAlignVert:= 1
local cUnit:= "CM"
nRow += 0.2
nCol += 0.2
nWidth -= 0.4
nHeight -= 0.4
x:= nRow+nX
y:= nCol+nY
z:= x+nAlt
k:= y+nLar
//--------------------------------------------------------------------------//
oFnt:=TFont():New(cFontName ,0,-nFontSize,.F.,lBold ,,,,lItalic,,,,,,,oPrn)
IF lBordo
oPrn:Box(X, Y, Z, K,;
{ nColorBordo, (nSizeBordo) }, nBackcolor, ;
{cText, oFnt, nColorFont, "TL" }, ;
cUnit )
else
oPrn:Box(X, Y, Z, K,;
{ CLR_WHITE, 1 }, CLR_WHITE, ;
{cText, oFnt, nColorFont, "TL" }, ;
cUnit )
endif
oFnt:end()
//----------------------------------------------------------------------------//
return nil
the following parameters are identical to both tests but behave differently
the Box values are also the same
local nWidth := 20 +0.2
local nHeight := 7.80 +0.5
local nGutter := 0.5
local nRows := 3
local nCols := 1
local nPrintHeight := nRows * ( nHeight + nGutter ) - nGutter
local nPrintWidth := nCols * ( nWidth + nGutter ) - nGutter
nTopMargin := ( nPageH - nPrintHeight ) / 2
nLeftMargin := ( nPageW - nPrintWidth ) / 2
If I insert
oPrn:nYoffset := 150
oPrn:nXoffset := 120
I have this result

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com