Page 1 of 1

Losing link when exporting to HTML

Posted: Wed Nov 01, 2006 2:24 pm
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]

Posted: Wed Nov 01, 2006 2:51 pm
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;

Posted: Wed Nov 01, 2006 5:59 pm
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]

Posted: Wed Nov 01, 2006 10:59 pm
by Sergey Tkachenko
Did you assign it to RichViewEdit1.OnWriteHyperLink? :)

Posted: Wed Nov 01, 2006 11:06 pm
by rtcary
Solved! Needed to add

RichViewEdit.OnWriteHyperlink := RichViewEditWriteHyperlink;

to my FormMain.

Thank you for the clue as where to look!!

Todd

Posted: Wed Nov 01, 2006 11:10 pm
by Sergey Tkachenko
This assignment can be made in design time, in Object Inspector