Sub ScaleOutput(P As Printer, N As Node, ZoomFactor As Double) As Node
Dim PL As PageLayout = P.GetDefaultPageLayout
Dim ScaleX,ScaleY As Double
Dim NJO As JavaObject = N
Dim JO As JavaObject = N
ScaleX = ZoomFactor * PL.GetPrintableWidth / JO.RunMethodJO("getBoundsInParent",Null).RunMethod("getWidth",Null)
ScaleY = ZoomFactor * PL.GetPrintableHeight / JO.RunMethodJO("getBoundsInParent",Null).RunMethod("getHeight",Null)
Dim SJO As JavaObject
SJO.InitializeNewInstance("javafx.scene.transform.Scale",Array(ScaleX,ScaleY))
NJO.RunMethodJO("getTransforms",Null).RunMethod("add",Array(SJO))
Return NJO
End Sub