Page 1 of 1

Relative hyperlinks

Posted: Tue Aug 30, 2005 8:07 am
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.

Posted: Tue Aug 30, 2005 11:30 am
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.

Posted: Tue Aug 30, 2005 12:22 pm
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://

Posted: Tue Aug 30, 2005 3:34 pm
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.

Posted: Wed Aug 31, 2005 8:19 am
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.

Posted: Mon Sep 05, 2005 11:58 am
by Sergey Tkachenko
It took a while, but now this update is available for registered users.

Posted: Mon Sep 05, 2005 3:23 pm
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.

Posted: Tue Sep 06, 2005 7:05 pm
by wvd_vegt
Hi

I installed the latest beta but cannot find the mentioned RTFReadProperties.BasePathLinks in neither TRichView nor TRichEdit.

Posted: Tue Sep 06, 2005 8:00 pm
by Sergey Tkachenko
Strange, which version number is displayed on TRichView controls at designtime? It should be 1.9.16

Posted: Tue Sep 06, 2005 9:16 pm
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!