I cannot seem to convert an HTML with a link to RTF – the link color is exported but not the actual link.
I used TRvHtmlImporter2.LoadHtml / TRichView.SaveRTFToStream
I used the following HTML:
<html><body>This activity was created by <b><a href="http://www.dimastr.com/redemption">Rede ... ody></html>
Which generated the RTF below.
Did I forget to set a particular flag?
Thank you!
{\rtf1\ansi\ansicpg0\uc1\deff0\deflang0\deflangfe0{\fonttbl{\f0\fnil Arial;}{\f1\fnil Times New Roman;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
\pard\fi0\li0\ql\ri0\sb0\sa0\itap0 \plain \f0\fs20 This activity was created by \plain \f0\ul\fs20\cf2 Redemption\par}
Converting HTML to RTF
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Consider upgrading to the newest version, free updates did not expire for you order. I opened protected forums for your account, you can find new version in the protected "Announcements" forum.
If you do not want to upgrade now, a typical processing of these events is:
- OnReadHyperlink: storing the link target in the item tag
- OnWriteHyperlink: getting the link target from the item tag.
If you do not want to upgrade now, a typical processing of these events is:
- OnReadHyperlink: storing the link target in the item tag
- OnWriteHyperlink: getting the link target from the item tag.
Code: Select all
procedure TMyForm.MyRichViewReadHyperlink(Sender: TCustomRichView;
const Target, Extras: String; DocFormat: TRVLoadFormat;
var StyleNo: Integer; var ItemTag: TRVTag;
var ItemName: TRVRawByteString);
begin
ItemTag := Target;
end;
procedure TMyForm.MyRichViewWriteHyperlink(
Sender: TCustomRichView; id: Integer;
RVData: TCustomRVData; ItemNo: Integer;
SaveFormat: TRVSaveFormat;
var Target, Extras: String);
begin
Target := RVData.GetItemTag(ItemNo);
end;