B4J Question Printing trouble

Chicao99

Member
Licensed User
Longtime 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):

PrintForm.RootPane.RemoveAllNodes

Dim scp As ScrollPane
scp.Initialize("scp")

PrintForm.RootPane.AddNode(scp,0,0,605,870)

Dim p As Pane = scp.InnerNode

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

PrintForm.Show


My printing routine:

Dim PA As Paper
PA.Initialize()
PA = Paper_static.A4

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

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

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


Can anybody help me?
 

Daestrum

Expert
Licensed User
Longtime 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.
 
Upvote 0

Chicao99

Member
Licensed User
Longtime User
It didn't work:
B4X:
    PrintForm.RootPane.RemoveAllNodes
   
    PrintForm.RootPane.AddNode(pdf,0,0,605,3000)
   
    PrintForm.Show

It always print the top left quarter, see pdf attached.
 

Attachments

  • JavaFX Print Jobbbbb.pdf
    192.9 KB · Views: 262
Upvote 0
Top