April 27, 2012

Blavov Blavov
Lab Rat
1 posts

printing html QTextDocument prints images wrong…

 

Hello all,
I have a small but nagging problem with Qt running on Linux Mint. I have a simple HTML QTextDocument that I want to print out using QPrinter. The document looks much like this:

  1. <p>Text block 1</p>
  2. <p>Text block 2</p>
  3. .
  4. .
  5. .
  6. <p><img src="/path/to/file.png" /></p>

Now, the text blocks are printed as expected, but the image is blown up to about three times its size in both vertical and horizontal direction. I have tried about a dozen ways of adding more or less explicit height and width parameters (as pixels, percentages, millmetres, with height & width attributes or in a style attribute) to no avail, the image looks always exactly the same.

Can somebody tell me how I must include an image reference into a html QTextDocument in order to get the system to print it properly and not magnified that way?

Thanks in advance, Pit.

0 replies

 
  ‹‹ [Solved] Same code not working if used as a function from a different method      [SOLVED] Access to custom widget’s object after dynamic Ui loading ››

You must log in to post a reply. Not a member yet? Register here!