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
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Windows, Classes, SysUtils, FileUtil, PrintersDlgs, Forms, Controls, Graphics,
Dialogs, StdCtrls, HtmlView;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
HtmlViewer1: THtmlViewer;
PrintDialog1: TPrintDialog;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
HtmlViewer1.LoadFromFile('test.htm');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if PrintDialog1.Execute then
begin
HtmlViewer1.Print(1,1);
end;
end;
end.