B4J Question [SOLVED] Print tableview to 1 A4

Lahksman

Active Member
Licensed User
Longtime User
I'm looking for the easiest way to print a tableview. I have tried jFX8Print but this only prints what fits on one page without giving me the ability to fit to page.
1697715469619.png

The total number of columns depends on the necessary steps in the production process.
 
Solution
The javafx print library only provides the functionality to print what is actually displayed on a view (with the exception of a webview).

You can use the provided sub ScaleOutput to scale the view to print on a single page. With larger views, you may not actually be able to read the printed output.

It is up to the developer to decide what is printed on a page and provide a view that is capable of being printed and read on the paper size chosen.

Probably the easiest way would be to take a snapshot of the entire view and split the resulting image into two Imageview's and print them on separate pages.

stevel05

Expert
Licensed User
Longtime User
The javafx print library only provides the functionality to print what is actually displayed on a view (with the exception of a webview).

You can use the provided sub ScaleOutput to scale the view to print on a single page. With larger views, you may not actually be able to read the printed output.

It is up to the developer to decide what is printed on a page and provide a view that is capable of being printed and read on the paper size chosen.

Probably the easiest way would be to take a snapshot of the entire view and split the resulting image into two Imageview's and print them on separate pages.
 
Upvote 2
Solution

stevel05

Expert
Licensed User
Longtime User
I've just realised that the code is not available in the B4xlib, so have added the project, and code to the first post in the project. although as I said, it may not be helpful in your situation.
 
Upvote 0

Lahksman

Active Member
Licensed User
Longtime User
I've just realised that the code is not available in the B4xlib, so have added the project, and code to the first post in the project. although as I said, it may not be helpful in your situation.
It took a little fiddling with the scale, but eventualy I've been able to print something that's acceptable. In the end it's just a quick print that the production leader can take with him.
 
Upvote 0
Top