I can't get the background to show as white, and after scaling, I can't get the BBCodeview back to original scaling. Any ideas?
I should add that my printer is a black and white HP laser printer, so the faint gray background I see on paper could be a faint color. I don't know.
I should add that my printer is a black and white HP laser printer, so the faint gray background I see on paper could be a faint color. I don't know.
B4X:
BBCV.mBase.SetColorAndBorder(xui.Color_White, 0, xui.Color_White, 0)
Dim P As Printer = Printer_Static.GetDefaultPrinter
Dim PJ As PrinterJob = PrinterJob_Static.CreatePrinterJob2(P)
Private pl As PageLayout = P.CreatePageLayout(P.GetPrinterAttributes.GetDefaultPaper, PageOrientation_Static.PORTRAIT, 0.5, 0.5, 0.5, 0.5)
PJ.GetJobSettings.SetPageLayout(pl)
If PJ.ShowPrintDialog(Null) Then PJ.PrintPage(ScaleOutput(P, BBCV.mBase))
PJ.EndJob
B4X:
Sub ScaleOutput(P As Printer, N As Node) As Node
Dim PL As PageLayout = P.GetDefaultPageLayout
Dim ScaleX,ScaleY As Double
Dim NJO As JavaObject = N
Dim JO As JavaObject = N
ScaleX = PL.GetPrintableWidth / JO.RunMethodJO("getBoundsInParent",Null).RunMethod("getWidth",Null)
'ScaleY = PL.GetPrintableHeight / JO.RunMethodJO("getBoundsInParent",Null).RunMethod("getHeight",Null)
ScaleY = ScaleX
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
Last edited: