Recent

Author Topic: [SOLVED] HtmlViewer print function error  (Read 3101 times)

Wilk

  • Newbie
  • Posts: 2
[SOLVED] HtmlViewer print function error
« on: October 22, 2018, 10:11:35 am »
Hello,
  I have some problems with HtmlViewer (FrameViewer09 11.8.0) print function in Lazarus 1.8.0 and newer. Below is example which should work but it always make strange error. In attachments are screenshots. Anybody has idea what is wrong with new version of HtmlViewer? Something is not compatible with Lazarus 1.8.0 / Lazarus 1.8.4? Of what I remember I have created last time a program with HtmlViewer in Lazarus 1.6.4 and HtmlViewer 11.7 (I guess) and printing was working without any problems.

Anybody has solution for this? Maybe I'm doing something wrong.

Error: Project project1 raised exception class 'External: SIGSEGV'. At address 44AFBC

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Windows, Classes, SysUtils, FileUtil, PrintersDlgs, Forms, Controls, Graphics,
  9.   Dialogs, StdCtrls, HtmlView;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     Button1: TButton;
  17.     Button2: TButton;
  18.     HtmlViewer1: THtmlViewer;
  19.     PrintDialog1: TPrintDialog;
  20.     procedure Button1Click(Sender: TObject);
  21.     procedure Button2Click(Sender: TObject);
  22.   private
  23.  
  24.   public
  25.  
  26.   end;
  27.  
  28. var
  29.   Form1: TForm1;
  30.  
  31. implementation
  32.  
  33. {$R *.lfm}
  34.  
  35. { TForm1 }
  36.  
  37. procedure TForm1.Button1Click(Sender: TObject);
  38. begin
  39.   HtmlViewer1.LoadFromFile('test.htm');
  40. end;
  41.  
  42. procedure TForm1.Button2Click(Sender: TObject);
  43. begin
  44.   if PrintDialog1.Execute then
  45.   begin
  46.     HtmlViewer1.Print(1,1);
  47.   end;
  48. end;
  49.  
  50. end.
  51.  

« Last Edit: October 22, 2018, 05:31:00 pm by Wilk »

Soner

  • Sr. Member
  • ****
  • Posts: 305
Re: HtmlViewer print function error
« Reply #1 on: October 22, 2018, 03:38:37 pm »
I tested frameviewer-demo now and it  ist printing without error.
I tested wHtmlViewer 1.17 and 1.18(current version) with Lazarus 1.8.5.
It worked also with Lazarus 1.8.2.

I downloaded the original from https://github.com/BerndGabriel/HtmlViewer

Wilk

  • Newbie
  • Posts: 2
Re: HtmlViewer print function error
« Reply #2 on: October 22, 2018, 04:18:59 pm »
You've right. This version https://github.com/BerndGabriel/HtmlViewer from branch master (https://github.com/BerndGabriel/HtmlViewer/tree/master) is working properly.
So it means the HtmlViewer version at OPM (OnlinePackageManager) is wrong and should be updated to this version https://github.com/BerndGabriel/HtmlViewer/tree/master

Thank you for your time for checking :)

egsuh

  • Hero Member
  • *****
  • Posts: 1266
Re: [SOLVED] HtmlViewer print function error
« Reply #3 on: August 16, 2021, 10:49:42 am »
I found this is not fixed yet. The final .lpk file (already two years ago) is version 11.9, but Online Package Manager seems to be still providing v11.8.

 

TinyPortal © 2005-2018