Recent

Author Topic: Printing HtmlViewer under Linux  (Read 2567 times)

toplek

  • Jr. Member
  • **
  • Posts: 53
Printing HtmlViewer under Linux
« on: April 16, 2018, 09:17:38 am »
Hello,
I have already asked a question about printing under Linux and paper dimentions, but the problem is still not solved. To be more general (maybe someone knows any solution), this is the code that works under Windows, but under Linux prints only a blank page. Alextp suggests that it's a problem of a color depth. Do you possibly know how to print a HtmlViewer under Linux?

Code: Pascal  [Select][+][-]
  1. Printer.Orientation:=poLandscape;
  2.  
  3. Printer.BeginDoc;
  4.  
  5. HtmlViewer1.Draw(Printer.Canvas,
  6.                    0,
  7.                    Printer.PageWidth,
  8.                    Printer.PageHeight,
  9.                    Printer.PageHeight); // Wysokosc poziomo.
  10.  
  11. Printer.EndDoc;
     
Any support would be greatly appreciated

zeljko

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Printing HtmlViewer under Linux
« Reply #1 on: April 16, 2018, 01:02:14 pm »
Have you tried with Qt lcl under linux ?

toplek

  • Jr. Member
  • **
  • Posts: 53
Re: Printing HtmlViewer under Linux
« Reply #2 on: May 09, 2018, 09:49:58 am »
I was not able to try it with Qt, but in the newest release of HtmlViewer, printing acts a little bit different. Now, using the same code, I am able to print all the bitmaps from HtmlViewer, but without any text...
Do you possibly know, what could be the problem?

toplek

  • Jr. Member
  • **
  • Posts: 53
Re: Printing HtmlViewer under Linux
« Reply #3 on: June 18, 2018, 09:09:46 am »
It looks like a problem with HtmlViewer itself. It can't properly draw on printer's canvas. Tried with Qt lcl, but the problem persists. I managed to print HtmlViewer form by drawing on bitmap canvas, and then drawing bitmap on printer's canvas. The only problem is that all text looks like scaled and jagged. Do you possibly know how to solve this problem?

 

TinyPortal © 2005-2018