Hi.
I looked some topic about HTML image save.
But i didnt understand anything
Becaus my english not good:(
My Problem:
I saved HTML file text in richview.
For Example:My HTML file is name Example.htm
1-Richview is creating Example.files directory.
2-Image path is being like 'Example.files/img1.gif' in HTML code.
But i am wanting;
1-Original image path in HTML code (like 'C:\Pic\Cat.bmp').
2-I am not wanting Example.files directory.
How can i do? Pls help me. I didnt understand anything before HTML images topic.
Pls send simple code example.
Thanks for everything. I am waiting:))
Image path when HTML saving(Pls hep me :(()
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
In order to store file names for pictures inserted by rvActionInsertPicture1, set rvActionInsertPicture1.StoreFileName = True (RichViewActions version v1.53 or newer is required).
In order to store file names for pictures inserted with RTF, set RichViewEdit1.RTFReadProperties.StoreImagesFileNames = True
(only for external pictures, not for pictures embedded in RTF)
In order to use these file names when exporting to HTML, include rvsoUseItemImageFileNames in rvActionExport1.SaveOptions.
Images with undefined file names (for example, pasted from the Clipboard) will still be saved in subdirectory (or in the same directory, if rvActionExport1.CreateDirectoryForHTMLImages = False)
In order to store file names for pictures inserted with RTF, set RichViewEdit1.RTFReadProperties.StoreImagesFileNames = True
(only for external pictures, not for pictures embedded in RTF)
In order to use these file names when exporting to HTML, include rvsoUseItemImageFileNames in rvActionExport1.SaveOptions.
Images with undefined file names (for example, pasted from the Clipboard) will still be saved in subdirectory (or in the same directory, if rvActionExport1.CreateDirectoryForHTMLImages = False)
Thanks Sergey.
I did.
But i have a new problem now:(
I hope you can help again.
For example:
1-Richview is not creating xxx.files directory.
2-Richview is using orginal path for images when exporting html. But orginal images paths being see like (.../.../example.jpg)
I must using real orginal path for images when html exporting.
Like (C:\Example\example.jpg).
Can i do real orginal path for all images???
Thanks for everything....
I did.
But i have a new problem now:(
I hope you can help again.
For example:
1-Richview is not creating xxx.files directory.
2-Richview is using orginal path for images when exporting html. But orginal images paths being see like (.../.../example.jpg)
I must using real orginal path for images when html exporting.
Like (C:\Example\example.jpg).
Can i do real orginal path for all images???
Thanks for everything....
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Yes, by default TRichView saves relative paths.
You can override it in OnHTMLSaveImage event:
You can override it in OnHTMLSaveImage event:
Code: Select all
procedure TForm3.RichViewEdit1HTMLSaveImage(Sender: TCustomRichView;
RVData: TCustomRVData; ItemNo: Integer; const Path: String;
BackgroundColor: TColor; var Location: String; var DoDefault: Boolean);
var FileName: String;
begin
if (ItemNo>=0) and
RVData.GetItemExtraStrProperty(ItemNo, rvespImageFileName, FileName) and
(FileName<>'') then begin
Location := FileName;
DoDefault := False;
end;
end;