B4J Question Print Node to fit page size

Nokia

Active Member
Licensed User
Longtime User
I'm trying to print a large node to fit page size whether it's portrait or Landscape. when I try to print to Canvas it come out blank. Also, not sure how to get current page size.

B4X:
    Dim PJ As PrinterJob = PrinterJob_Static.CreatePrinterJob
    Dim Img As Image
    Dim N As Node

    Img = fpDashBoard.Snapshot.As(B4XBitmap).Resize(fpDashBoard.Width/3,fpDashBoard.Height/3,True)
    N = fpDashBoard   
        
    Dim cv As Canvas
    cv.Initialize("")
    cv.DrawImage(Img,0dip,0dip,Img.Width,Img.Height)
    'fx.Clipboard.SetImage(cv.Snapshot)

    N.Enabled = False
        PJ.ShowPrintDialog(MainForm)
        PJ.PrintPage(cv)
        PJ.PrintPage(fpDashBoard)
        PJ.EndJob
    N.Enabled = True
 
Top