Results 1 to 2 of 2

Thread: Disappearing html table border when viewing pdf file prepared using QTextDocument

  1. #1
    Join Date
    Sep 2015
    Posts
    1

    Default Disappearing html table border when viewing pdf file prepared using QTextDocument

    Hello @all,

    I need to draw and print simple table to the PDF file. I'm using QTextDocument and html/css tags to draw nice table with 1px border on QPainter. When I'm viewing created PDF file in PDF viewer, borders of this table dissapear when zooming in/out the document. When I zoom in to the max I see all 1px borders of this table but when I zoom out again some borders dissapear. I thought that it's some kind of optimization of PDF viewer but the strange thing is that 1px lines/borders drawn using QPainter::drawLine() and printed in the same PDF file look good and don't disappear. So it looks to me like a problem of QTextDocument, but I'm not sure and would like to ask you for help. Thanks in advance!

    * I tried other PDF viewers too, both Windows and Linux and the same thing happened.
    * I tried to search through the forum to find similar cases but the answers I found didn't help me a lat (I cannot use Webkit etc).
    * I'm aware of the limitations mentioned here and I use only the supported subset of html/css tags.

  2. #2
    Join Date
    Oct 2015
    Posts
    1
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: Disappearing html table border when viewing pdf file prepared using QTextDocument

    Hi,

    try to draw QTextDocument on QImage and then draw this image on your QPrinter, this should solve your issue

Similar Threads

  1. QTextDocument Table border
    By Delphi in forum Qt Programming
    Replies: 2
    Last Post: 17th June 2013, 17:30
  2. Replies: 2
    Last Post: 21st March 2012, 15:30
  3. Replies: 4
    Last Post: 13th February 2012, 19:09
  4. QTextDocument Html URL
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 20th February 2008, 18:00
  5. QTextDocument Html
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2007, 13:50

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.