Sub PrintMultiplePage(Printer As Printer,PL As PageLayout,Panel As Pane, HeightPrinterPage As Double)
Dim Left,Top,Height,Width As Int
Dim TopPage=0,IndexNode As Int
Do While TopPage<Panel.Height
Dim PanePrint As Pane
Dim PJ As PrinterJob= PrinterJob_Static.CreatePrinterJob2(Printer)
PanePrint.Initialize("")
IndexNode=0
Do While IndexNode<Panel.NumberOfNodes
Dim V As Node = Panel.GetNode(IndexNode)
If V.Top>=TopPage And V.Top<(TopPage+HeightPrinterPage) Then
Left=V.Left
Top=V.Top-TopPage
Height=V.PrefHeight
Width=V.PrefWidth
V.RemoveNodeFromParent
PanePrint.AddNode(V,Left,Top,Width,Height)
Else
IndexNode=IndexNode+1
End If
Loop
PJ.PrintPage2(PL,PanePrint)
PJ.EndJob
For IndexNode=0 To PanePrint.NumberOfNodes-1
Dim V As Node = PanePrint.GetNode(0)
Left=V.Left
Top=V.Top+TopPage
Height=V.PrefHeight
Width=V.PrefWidth
V.RemoveNodeFromParent
Panel.AddNode(V,Left,Top,Width,Height)
Next
TopPage=TopPage+HeightPrinterPage
Loop
End Sub
Sub PrintMultiplePage(Printer As Printer,PL As PageLayout,Panel As Pane, HeightPrinterPage As Double)
Dim Page As Int = Round(Panel.Height/HeightPrinterPage)
Dim Left,Top,Height,Width, IndexNode As Int
For i=0 To Page-1
Dim PanePrint As Pane
Dim TopPage As Int = I * HeightPrinterPage
Dim PJ As PrinterJob= PrinterJob_Static.CreatePrinterJob2(Printer)
PanePrint.Initialize("")
Log(":::" & TopPage & "--" & Panel.NumberOfNodes)
IndexNode=0
Do While IndexNode<Panel.NumberOfNodes
Dim V As Node = Panel.GetNode(IndexNode)
Log("_" & V.Top)
If V.Top>=TopPage And V.Top<(TopPage+HeightPrinterPage) Then
Left=V.Left
Top=V.Top-TopPage
Height=V.PrefHeight
Width=V.PrefWidth
V.RemoveNodeFromParent
PanePrint.AddNode(V,Left,Top,Width,Height)
Else
IndexNode=IndexNode+1
End If
Loop
PJ.PrintPage2(PL,PanePrint)
PJ.EndJob
For IndexNode=0 To PanePrint.NumberOfNodes-1
Dim V As Node = PanePrint.GetNode(0)
Left=V.Left
Top=V.Top+TopPage
Height=V.PrefHeight
Width=V.PrefWidth
V.RemoveNodeFromParent
Panel.AddNode(V,Left,Top,Width,Height)
Next
Next
End Sub