Delphi FMX Android Printing with Sunmi V2 Device

34 views Asked by At

I am looking for a simple routine in Delphi FMX Android to print using my Device Sunmi V2? The device has a built in thermal printer.

I started looking at this https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Printing_from_a_FireMonkey_Application but this is only working in Windows.

This is a piece that is started:

var
  SrcRect, DestRect: TRectF;
begin
  { Set the default DPI for the printer. The SelectDPI routine defaults
    to the closest available resolution as reported by the driver. }
  Printer.ActivePrinter.SelectDPI(1200, 1200);
  { Start printing. }
  Printer.BeginDoc;
 
  if Printer.Canvas.BeginScene then
  try
    { Set canvas filling style. }
    Printer.Canvas.Fill.Color := claBlack;
    Printer.Canvas.Fill.Kind := TBrushKind.Solid;
 
    { Set the Source and Destination TRects. }
    SrcRect := Image1.LocalRect;
    DestRect := TRectF.Create(0, 0, Printer.PageWidth, Printer.PageHeight);
 
    { Print the picture on all the surfaces of the page and all opaque. }
    Printer.Canvas.DrawBitmap(Image1.Bitmap, SrcRect, DestRect, 1);
  finally
    Printer.Canvas.EndScene;
  end;
 
  { Finish printing job. }
  Printer.EndDoc;
end;
0

There are 0 answers