B4J Question jfx8print bbcodeview mystery

johnmie

Active Member
Licensed User
Longtime User
Hi,
I followed William's suggestion like this
B4X:
    Dim iv As ImageView = BBCodeViewM.ForegroundImageView
    Dim bmp As Image = iv.getimage
    Dim newiv As ImageView
    newiv.Initialize("")
    Try
        newiv.SetImage(bmp)
        Log("newiv set")
    Catch
        Log(LastException.message)
    End Try
    Dim P As Printer = Printer_Static.GetDefaultPrinter
    Dim PJ As PrinterJob = PrinterJob_Static.CreatePrinterJob2(P)
    PJ.ShowPrintDialog(Null)
    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, newiv))
    PJ.EndJob
but when printig to Adobe PDF, all I get is a blank page. Do you know why?
 

stevel05

Expert
Licensed User
Longtime User
Probably because newiv is not on a form, it would therefore not have a size as far as the print library is concerned.

Can you post a link to William's suggestion as I don't know what the original issue is.
 
Upvote 0

johnmie

Active Member
Licensed User
Longtime User
I found this in the forum when seraching jfx8pring bbcodeview as the last post under

[Solved] Printing BBCodeview using jFX8Print, scaling and background color​

 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Remove the try catch block, in my test
B4X:
Dim iv As ImageView = BBCV.ForegroundImageView
Dim bmp As Image = iv.GetImage

Returns an uninitialized image. You are losing that error with the try catch block or not seeing it in the log.
 
Last edited:
Upvote 0
Top