Relative hyperlinks

General TRichView support forum. Please post your questions here
Post Reply
wvd_vegt
Posts: 83
Joined: Tue Aug 30, 2005 7:39 am

Relative hyperlinks

Post by wvd_vegt »

Hi,

I modified the editor sample bit so i could use it in one of my projects. One thing however keeps bothering me:

When I insert a hyperlink that has a relative path, it shows up correctly as long as I edit. After a reload however it becomes absolute (including driveletter and path of the document).

Is there a way to prevent this?

What I'm looking for is just be able to supply a path starting with a directory name without richview or richedit changing it.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Which format do you use to store files? When saving to RVF, tags (where hyperlinks are stored) are not modified.
If you save to HTML and use RvHtmlImporter to read them, it has Options for full/relative paths.
wvd_vegt
Posts: 83
Joined: Tue Aug 30, 2005 7:39 am

Post by wvd_vegt »

Hi,

Thanks for the quick response.

I used Editor 2 from the delphi Demo's as a basis.

I save to RTF with:

Code: Select all

rvEditor.SaveRTF(fFileName, False);
Btw the filenames/url should have a format like:

Code: Select all

common/movie1.flv
so no protocol prefix like file:// or http://
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Well, really, on RTF import, TRichView adds the file path to relative links.
In the next update for registered users (I hope to upload it today) I'll add a new property TRichView.RTFReadProperties.BasePathLinks: Boolean. It will work like the corresponding option of RVHtmlImporter - when set to False, the file path will not be added to links.
wvd_vegt
Posts: 83
Joined: Tue Aug 30, 2005 7:39 am

Post by wvd_vegt »

Hi,

Great, the workaround I use now is not that good (just strip the path totally and try a couple of directories), but it holds for todays demo.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

It took a while, but now this update is available for registered users.
wvd_vegt
Posts: 83
Joined: Tue Aug 30, 2005 7:39 am

Post by wvd_vegt »

Hi,

I will have a look at it tonight. Thanks for implementing it so quickly.

Just for your information, It's not mentioned in the changes.
wvd_vegt
Posts: 83
Joined: Tue Aug 30, 2005 7:39 am

Post by wvd_vegt »

Hi

I installed the latest beta but cannot find the mentioned RTFReadProperties.BasePathLinks in neither TRichView nor TRichEdit.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Strange, which version number is displayed on TRichView controls at designtime? It should be 1.9.16
wvd_vegt
Posts: 83
Joined: Tue Aug 30, 2005 7:39 am

Post by wvd_vegt »

Hi

My excuses, i had old dcu's lingerign around. It's workging like charm. Thanks a lot for the very quick support!
Post Reply