I'm trying to print a JFrame and text looks different from what I see on screen. All graphics looks good and exactly as it is displayed but the text looks different, especially the spacing of the characters.
I tried different codes I found on the web but basically all of them uses the print method.
The problem is not related to the printer (a real one or a PDF one), the result is always different from what I see onscreen.
I searched on the web but no one seem to have the same issue. I tried different fonts and none of them worked but I noticed that the problem is more evident if font size is bigger.
Thanks in advance for you help.
Sorry, I thought that was a standard... I'm working on this software since years, I onestly forgot where I got all the pieces...
By the way, let's get another one, the result is the same:
And to call it:
Apart from that, what method should I use to simply print a Jpanel to a printer without all these problems?
I did a small example to replicate my very complex and long software and it's bug.
I tried also to remove the windows look and feel but it doesn't help much.
Just to be complete, I have tried to compile with different versions (1.6/1.7/1.8) because I have read on the internet that there is a similar bug in 1.6, but unfortunately it didn't help.
Another thing: in the code I posted above there is an incomplete html code in one of the two components, but it's not the problem.
Using plain text or html code makes no difference anyway.
Could someone give me a simple example on how could I use javax.print instead of java.awt.print?
I'm searching the web for a tutorial, but didn't find it yet.
Maybe this could help to solve the issue ...