B4J Library B4j Print JavaFX8

DieterR

Member
Licensed User
Longtime User
Thank You very much Erel!
"use Java 8" was the essential tip. I did not respect that "jFX8" is different from "jFX".
After I installed the latest Java Versions my program works perfect.
 

le_toubib

Active Member
Licensed User
Longtime User
that s owsom
i tried it with a webview1 to print an html file, but the result did not fit into an A4 page , HTML font may be too large , i donno, i set the paper layout with A4 , portrait , and margins of 5px.
how can i set the webview to fit into the A4 page ?
 

stevel05

Expert
Licensed User
Longtime User
No, it would have to be rendered to a webview, the FX routines will print the contents of a View.
 

tdocs2

Well-Known Member
Licensed User
Longtime User
Greetings.

I am able to print the first page of a multipage tableview. How do I have to show the tableview (e.g., Erel's Student Tableview) so that I am able to print several pages?

Thank you in advance for your replies.

Sandy
 

stevel05

Expert
Licensed User
Longtime User
It'll print whatever is displayed in the view, so you'll need to scroll the table and print it again for each page.
 

micro

Well-Known Member
Licensed User
Longtime User
He stevel05
why with your example view this error?
B4X:
B4J version: 3.61
Parsing code.    (0.01s)
Compiling code.    Error
Error compiling program.
Error description: Array expected.
Occurred on line: 23
PJ.ShowPageSetupDialog(Null)
Word: (
Thanks
 

stevel05

Expert
Licensed User
Longtime User
Hi Micro,

I just downloaded and ran it as is and I don't see that problem.

Steve
 

micro

Well-Known Member
Licensed User
Longtime User
If work with module (bas) is ok, but if you load the lib and remove the module declared twice, appears the error.
 

stevel05

Expert
Licensed User
Longtime User
The lib is compiled from the modules, you don't need both.
 

micro

Well-Known Member
Licensed User
Longtime User
In effect if i use the lib appears the error, while if i disables the loading lib and insert modules work fine.
Thanks
 

stevel05

Expert
Licensed User
Longtime User
Yes, you can use the library in a different project without having to load all of the related modules.
 

boten

Active Member
Licensed User
Longtime User
Tried to print a text area to PDF (using a PDF printer).
Text area has white background, but the pdf shows the text over a grayish rectangle the size of the textarea.

How can I print just the text without the bounding rectangle?

print is done via:
B4X:
Sub Button1_Action
   Dim PJ As PrinterJob = PrinterJob_Static.CreatePrinterJob
  PJ.ShowPageSetupDialog(Null)
  PJ.ShowPrintDialog(Null)
   PJ.PrintPage(TextArea1)
  PJ.EndJob
End Sub
 

stevel05

Expert
Licensed User
Longtime User
The Javafx8 print prints an entire view not just the text, you will need to change the background color of the view to suit.
 

boten

Active Member
Licensed User
Longtime User
The Javafx8 print prints an entire view not just the text, you will need to change the background color of the view to suit.
As I mentioned, the text area has white background

In the code I have:
B4X:
s=TextArea1.Style
TextArea1.Style=s & "-fx-background: #FFFFFF"  
Log(s)

and logged the style. Log says:
B4X:
-fx-font-family:Georgia;-fx-font-size:22.00;-fx-border-color:#FFFFFF;
-fx-border-width:0.00;-fx-background: #FFFFFF
 

boten

Active Member
Licensed User
Longtime User
In contrast to TextArea - a Label with white background prints just fine
 

boten

Active Member
Licensed User
Longtime User
........... (See attached project).

Very interesting Steve.
Since I need to change the text's font, fontsize and alignment, and since a Label is easier to change, I decided to stick with a label and copy the textarea's text to Label.text
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…