B4J Question Printing trouble

Discussion in 'B4J Questions' started by Chicao99, Sep 16, 2019.

  1. Chicao99

    Chicao99 Member Licensed User

    Hi guys, I am expecting some difficults trying to print a canvas. It always prints just the first quarter of the page.

    The beggining of my canvas building (pdf is my canvas):


    Dim scp As ScrollPane


    Dim p As Pane = scp.InnerNode

    p.AddNode(pdf, 0, 0, 605, 3000)


    My printing routine:

    Dim PA As Paper
    PA = Paper_static.A4

    Dim PR As Printer = GetPrinter("PDF Architect 4")

    Dim PL As PageLayout
    PL = PR.CreatePageLayout2(PA, PageOrientation_Static.PORTRAIT, "HARDWARE_MINIMUM")

    Dim PJ As PrinterJob = PrinterJob_Static.CreatePrinterJob2(PR) 'CreatePrinterJob
    PJ.PrintPage2(PL, pdf)

    Can anybody help me?
  2. Erel

    Erel Administrator Staff Member Licensed User

    1. Moved to B4J forum.
    2. Please use [code]code here...[/code] tags when posting code.
  3. Daestrum

    Daestrum Well-Known Member Licensed User

    Could it be the fact that javafx only prints the visible part of nodes. If the canvas is in a scrollpane and not entirely visible, only the part showing will print.
    Similar to how a tableview will only print the visible rows, not the one that are not scrolled into view.

    As a (possible) solution put the canvas into a node that is large enough to view it and print that. eg, create a node 605 x 3000 and print that.
  4. Chicao99

    Chicao99 Member Licensed User

    It didn't work:
    It always print the top left quarter, see pdf attached.

    Attached Files:

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice