Hola a todos.
Yo y mis rarezas. Estoy intentando imprimir desde un programa Multidispositivo (FMX) en Windows.
Tengo estas Strings de prueba.
Código Delphi
[-]
MemoFac.Lines.Clear;
TitNR := #13#10+' DATOS GLOBALES DE FACTURAS NORMALES '+#13#10+#13#10;
TitND := #13#10+' RESUMEN DETALLADO DE FACTURAS NORMALES '+#13#10+#13#10;
TitRR := #13#10+' DATOS GLOBALES DE FACTURAS RECTIFICATIVAS '+#13#10+#13#10;
TitRD := #13#10+' RESUMEN DETALLADO DE FACTURAS RECTIFICATIVAS '+#13#10+#13#10;
SepN := '|-------|------------|------------------------------|----------|---------|---------|'+#13#10;
SepR := '|----------|---------------------------------------------------|---------|---------|'+#13#10;
CabeD := ' Fechas | Nº Factura | Nombre | N.I.F. | Base | IVA |'+#13#10;
CabeR := '|Canti Fact| Intervalo temporal considerado |Tot. Base|Tot. IVA |'+#13#10;
IniD := '|========|============|==============================|==========|=========|=========|'+#13#10;
IniR := '|==========|===================================================|=========|=========|'+#10;
FinD := '|========|============|==============================|==========|=========|=========|'+#13#10;
FinR := '|==========|===================================================|=========|=========|'+#13#10;
Me resulta más intuitivo el grupo
#13#10 que
sLineBreak . Mis disculpas.
Cuando las listo por pantalla en un TMemo. Salen perfectas.
El problema es cuando intento imprimir
Código Delphi
[-]
procedure Imprimir;
var
MyRect : TRectF;
V1 : integer;
S : String;
begin
with Printer.Canvas
do begin
try Printer.BeginDoc;
Font.Size := Form1.Pica.Font.Size;
Font.Family := Form1.Pica.Font.Family;
Font.Style := Form1.Pica.Font.Style;
Fill.Color := Form1.Pica.TextSettings.FontColor;
V1 := 155;
MyRect.Create(IH(0),IV(v1),ih(Printer.PageWidth-150),iv(v1+75));
FillText(MyRect, TitNR, False, 100,[TFillTextFlag.RightToLeft], TTextAlign.Leading, TTextAlign.Center);
v1 := v1 + 75;
MyRect.Create(IH(0),IV(v1),ih(Printer.PageWidth-150),iv(v1+75));
FillText(MyRect, IniR, False, 100,[TFillTextFlag.RightToLeft], TTextAlign.Leading, TTextAlign.Center);
v1 := v1 + 75;
MyRect.Create(IH(0),IV(v1),ih(Printer.PageWidth-150),iv(v1+75));
FillText(MyRect, CabeR, False, 100,[TFillTextFlag.RightToLeft], TTextAlign.Leading, TTextAlign.Center);
v1 := v1 + 75;
MyRect.Create(IH(0),IV(v1),ih(Printer.PageWidth-150),iv(v1+75));
FillText(MyRect, FinR, False, 100,[TFillTextFlag.RightToLeft], TTextAlign.Leading, TTextAlign.Center);
v1 := v1 + 75;
Printer.EndDoc;
except
Printer.Abort;
raise;
end;
end;
end;
El resultado es este
Código Delphi
[-]
' DATOS GLOBALES DE FACTURAS NORMALES '
'|=========|=========|===================================================|==========|'
'|Canti Fact| Intervalo temporal considerado |Tot. Base|Tot. IVA |'
'|=========|=========|===================================================|==========|'
No entiendo la inversión de la escritura.
Por favor, si alguien me lo puede explicar os lo agradeceré infinito.
Saludos cordiales a todos.