Solved PDF output from QPrinter cuts last letter of words if the html characters are generated with cyrillic support
-
@mardzo
Yes that is a bit odd. But cyrillic is another font, i assume?
So it could react differently being upscaled/created for the printer context.
A printer has many more DPI than the screen so some scaling is involved as else
it would just be ultra tiny. ( when printed)
Could also be a bug in the font handling so the actual size of the cyrillic is reported incorrectly.Is it possivble to get the actual HTML that you print?
( so I can try it) -
@mrjj I create it dynamically so i cant send it all. I tried so save it all in a txt file, but the cyrilic characters are replaced with ??????. here is a small snippet with cyrilic characters in it. Im sorry for the bad formatting
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="qrichtext" content="1"> <title>QTextEdit Example</title> <style type="text/css">p, li { white-space: pre-wrap; } </style> </head> <body style=" font-family:Tahoma; font-size:9pt; font-weight:300; font-style:normal;"> <table align=center style = "margin-top:50px; margin-right:20px; "> <tr><th><h2>Извештај за настани од контрола на пристап</h2></th> </tr> </table> <table align=center style='margin-top:10px; margin-right:20px; '> <tr> <td>Филтер:</td> <td>Сите логови</td> <td>Од:</td> <td>28.11.2016</td> <td>До:</td> <td>28.11.2016</td> </tr> </table>" <table style = 'text-align: left; padding: 1px; background-color: #fff; font-size:6pt;' border=2 align=center cellspacing=1 width=440 > <tr> <th>Бр.</th> <th>Уред</th> <th>Лог</th> <th>Врата</th> <th>Корисник</th> <th>Датум и Време</th> </tr> </table> </body> </html>
-
Hi
Super.
I get this
Is that ok test case?
-
@mrjj yes, this is okay but what happens when you try to set style="font-size : 6pt;" on the table and export it as pdf? Does it cut the last letter of the cyrillic words? I edited the previously posted html
-
Hi
Super.
style="font-size : 6pt;"
As set stylesheet on it or?I will retry with the new html.
-
@mrjj yes, try with the exact new html i posted
-
@mardzo
Hmm seems to be 1-1 one
Can we try reverse and see if u get same?
https://www.dropbox.com/s/kxu7drheoulah3p/myTextEdit.zip?dl=0 -
@mrjj yes your project works fine i have tried it and got a good pdf :). But did u notice that when u input the html in the qtextedit in the ui it alters the html adding spans. paragrarphs etc.? Do u suggest for me to change my html table based on the changes the QT Designer made to it?
-
Bloody hell! I figured it out. The only thing i needed to do was to put <span></span> inside the table cells. Thanks @mrjj for your help.
-
@mardzo
Super. Good work. Well i was wondering what the difference was between screen
and pdf and you found it :)