Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with TPrinter with printer scale Borland 6.0 c++

Hello,

 

I'm having problems by using TPrinter in Borland 6.0 with some configuration modes on the printer. When I resize the scale of the printer by the configuration assistant of the installed printer it only resize the text entries, not lines or positions... I don't know how to do it... here's a sample of my code:

 

void ImprimirLoggersPWR()
{
TPrinter *Prntr=Printer();
int i,x1,x2,y=MargeY,columna,fila,NumLog;
TRect TR;
bool ImprPag;
double Size;

NumLog=17;
Size=(Prntr->PageHeight-400-MargeY)/(46*NumLog+30);

if(Form1->Imprimir->Execute())
{
Prntr->BeginDoc();
//TÍTOL-----------
Prntr->Title=Txt[TXT_PRNTR_PWR_TITLE];
Prntr->Canvas->Pen->Color=clBlack;
Prntr->Canvas->Font->Size=(4*Size+36)/7;
Prntr->Canvas->Font->Style=TFontStyles()<< fsBold << fsUnderline;
Prntr->Canvas->TextOut(MargeX, y, Prntr->Title);
//PàGINA----------
ImprPag=true;
//----------------
y=y+(30*Size);
for(i=0;i<Herramientas->LogPWRAdquirits->Count;i++)
{
if(y+46*Size>=Prntr->PageHeight-400)
{

Prntr->NewPage();
y=MargeY + 30*Size;
ImprPag=true;


}
if(ImprPag)
{
Prntr->Canvas->Font->Size=2*(Size+23.2)/5.6;
Prntr->Canvas->Font->Style=TFontStyles()<< fsBold;
Prntr->Canvas->TextOut((Prntr->PageWidth)/2,Prntr->PageHeight-200,"- "+AnsiString(Prntr->PageNumber)+" -");
ImprPag=false;
}
if(Herramientas->LogPWRAdquirits->Checked[i])
{

y=y+10*Size;
//LOGGER
Prntr->Canvas->Font->Size=10*Size/10;
Prntr->Canvas->Font->Style=TFontStyles()<< fsBold << fsItalic;
Prntr->Canvas->TextOut(MargeX, y, Taules2[i]->PWRFrame->Caption);

y=y+10*Size;
for (fila=0;fila<Taules2[i]->PWR->RowCount;fila++)
{
x2=MargeX;
for(columna=0;columna<Taules2[i]->PWR->ColCount;columna++)
{
Prntr->Canvas->Font->Style=TFontStyles() >> fsBold >> fsUnderline >> fsItalic >> fsStrikeOut;
if (columna==0 || fila==0)
{
Prntr->Canvas->Brush->Color=ColorTaula;
Prntr->Canvas->Font->Style=TFontStyles() << fsBold;
}
else
{
Prntr->Canvas->Brush->Color=clWhite;
Prntr->Canvas->Font->Style=TFontStyles() >> fsBold;
}
Prntr->Canvas->Font->Size=9*Size/10;
x1=x2;
x2=x1+0.85*Size*(Taules2[i]->PWR->ColWidths[columna]);
TR=Rect(x1,y,x2,y+13*Size);
Prntr->Canvas->FillRect(TR);
Prntr->Canvas->Rectangle(x1,y,x2,y+13*Size);
Prntr->Canvas->TextOut(x1+3*Size,y+3*Size,Taules2[i]->PWR->Cells[columna][fila]);

}
y=y+13*Size;
}

}
}
Prntr->EndDoc();
}
}

 

If anyone understands what's happening please answer to me, thanks!

 

Regards,

 

ldiaz

0 Kudos
Message 1 of 3
(3,610 Views)

What does this question have to do with National Instruments DAQ boards, or any NI product for that matter?

0 Kudos
Message 2 of 3
(3,602 Views)

Sorry I saw some Borland 6.0 questions on this forum and I though it could be possible that someone answer my question. If it's not the correct forum, don't worry about the question. 

 

Thanks.

0 Kudos
Message 3 of 3
(3,593 Views)