Hi all , I'm trying to print a webview to Microsoft print to pdf using built in jfx8print, and it works fine except that the arabic letters are printed in reverse ??? the html file shows normally on browser and also print to pdf normally from browser ... this also happens with HP printer , arabic letters reversed if printed with jfx8print ..
p.s : same file is printed normally using printhtml.exe .... example :
Hi.
1. The first thing I'd like to mention is this: when you attempt to print the contents, choose "A4" as the output format. In my case, when I chose other formats, the title's letters printed backwards (I use Farsi text, but it's the same concept!) See if that works.
2. I use the following method to print the contents of a webview. See how this one works:
B4X:
Sub PrintWebView(w As WebView)
Dim PJ As PrinterJob = PrinterJob_Static.CreatePrinterJob
PJ.ShowPageSetupDialog(Null)
PJ.ShowPrintDialog(Null)
Dim WVJO As JavaObject = w
WVJO.RunMethodJO("getEngine",Null).RunMethod("print",Array(PJ.GetObject))
PJ.EndJob
End Sub
Thank you for your reply , I appreciate ur help
I m using the exact same method , with A4 portrait pagelayout , but the results differs from printer to printer , arabic letters sometimes reversed , sometimes not ..
Incidentally , how do u shrink contents to fit A4 sized webview ???
Thanks again
I know, it's annoying how right-to-left language output is sometimes messed up like that for no logical reason.
When I load my own html (usually tables of data) into the webview, it fits the page automatically.
But when there is an image I need printed, I use the node's Snapshot:
B4X:
Dim str As String = "<html><head></head><body><img src=""" & File.GetUri(File.DirApp, "/temp/chart.png") & """></body></html>"
Dim w As WebView
w.Initialize("")
w.LoadHtml(str)
PrintWebView(w)
So far I haven't had scaling problems, but to make things more convenient, I've also added the option to open the created HTML with Microsoft Word, so my clients can print it from there. That way they can make any adjustments they want.
I hope you find a way to fix it.