B4J Question Java jfx8Print not printing to Xprinter Thermal Printer

Reminisce

Active Member
I am trying to print this Node (Pane) to a 58mm X-printer, but nothing happens. I have tried to print from other programs and it print fine.

B4X:
Sub btnprint_MouseClicked (EventData As MouseEvent)
  
  
im result As Boolean 
Dim m As Map
m.Initialize
m.Put("top",pnlprint.Top)
m.Put("left",pnlprint.Left)
    pnlprint.Left=0
    pnlprint.Top = 0
    
    Dim printerjob As PrinterJob

    Dim p As Printer = Printer_Static.GetDefaultPrinter
    printerjob = PrinterJob_Static.CreatePrinterJob2(p)
    printerjob.ShowPrintDialog(Null)
    printerjob.PrintPage(pnlprint)
    printerjob.EndJob
    
pnlprint.Left = m.Get("left")
pnlprint.top = m.Get("top")
end sub

how do I achieve this and set the correct paper size?
57mm x 40mm
 

Attachments

  • Capture.JPG
    Capture.JPG
    81.5 KB · Views: 286
Last edited:
Top