Public Sub Prints(i As Int) As ResumableSub
'save file and upload it
For Each n As Node In PanelsforPages(i).GetAllViewsRecursive
If n Is TextArea Then
Dim ta As TextArea = n
CSSUtils.SetBackgroundColor(ta, fx.Colors.white)
CSSUtils.SetStyleProperty(ta, "-fx-control-inner-background", "white")
CSSUtils.SetStyleProperty(ta, "-fx-focus-color", "white")
else If n Is TextField Then
Dim tf As TextField = n
CSSUtils.SetBackgroundColor(tf, fx.Colors.White)
End If
Next
Dim fn As String = "filename" & "_" & i & ".jpg"
Dim Out As OutputStream = File.OpenOutput(File.Dirdata("Averroes") & "\foldername\" , fn,False)
PanelsforPages(i).Snapshot.WriteToStream(Out)
Out.Close
wait for (UploadFile(fn)) Complete (rslts As Object)
Sleep(10)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''print
Dim count As Int = 2
Dim pr As Printer
pr = Printer_Static.GetDefaultPrinter
Dim PA As Paper
PA.Initialize()
PA = Paper_static.A4
Dim PL As PageLayout
PL.Initialize()
PL = pr.CreatePageLayout2(PA, PageOrientation_Static.PORTRAIT, "HARDWARE_MINIMUM")
Dim PJ As PrinterJob = PrinterJob_Static.CreatePrinterJob2(pr) 'CreatePrinterJob
PJ.GetJobSettings.SetCopies(count)
PJ.GetJobSettings.SetJobName("Job Name")
PJ.PrintPage2(PL, PanelsforPages(i))
PJ.EndJob
Return Null
End Sub