Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Printing html QTextDocument prints images wrong...
Qt 6.11 is out! See what's new in the release blog

Printing html QTextDocument prints images wrong...

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    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:
    @<p>Text block 1</p>
    <p>Text block 2</p>
    .
    .
    .
    <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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved