Losing link when exporting to HTML

General TRichView support forum. Please post your questions here
Post Reply
rtcary
Posts: 12
Joined: Sun Apr 16, 2006 4:03 am

Losing link when exporting to HTML

Post by rtcary »

I am using RichView 1.9.24 (Delphi 5). When I create a link and then Export it as HTML, the link is missing:

Code: Select all

 

<body>

<p>Press <span class=rvts1>here</span> to see more pictures.</p>

</body></html>
The link is in the rvf file.

Am I missing something with the installation since the demo works correctly?

Many thanks.....[/code]
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Process OnWriteHyperlink event.
Default code for this event, if link targets are stored in tags, is:

Code: Select all

procedure TForm3.RichViewEdit1WriteHyperlink(Sender: TCustomRichView;
  id: Integer; RVData: TCustomRVData; ItemNo: Integer;
  SaveFormat: TRVSaveFormat; var Target, Extras: String);
begin
  Target := PChar(RVData.GetItemTag(ItemNo));
end;
rtcary
Posts: 12
Joined: Sun Apr 16, 2006 4:03 am

Post by rtcary »

This code is in place, but when I put a break point on it, it does not get executed when exporting to HTML.

Code: Select all

// Exporting hyperlink to RTF and HTML
procedure TFormSimpleEdit.RichViewEditWriteHyperlink(Sender: TCustomRichView;
  id: Integer; RVData: TCustomRVData; ItemNo: Integer;
  SaveFormat: TRVSaveFormat; var Target, Extras: String);
begin
  Target := PChar(RVData.GetItemTag(ItemNo));
end;
Todd[/code]
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Did you assign it to RichViewEdit1.OnWriteHyperLink? :)
rtcary
Posts: 12
Joined: Sun Apr 16, 2006 4:03 am

Post by rtcary »

Solved! Needed to add

RichViewEdit.OnWriteHyperlink := RichViewEditWriteHyperlink;

to my FormMain.

Thank you for the clue as where to look!!

Todd
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This assignment can be made in design time, in Object Inspector
Post Reply