Save RichView to Inlinehtml

General TRichView support forum. Please post your questions here
Post Reply
retwas
Posts: 39
Joined: Tue May 21, 2013 1:41 pm

Save RichView to Inlinehtml

Post by retwas »

Hi

I would like to same the content of a TRichview (Text, CSS, Image) in only one html files, all inline.

Does it's possible ?

When I use SaveHTMLToStream I have linebreak..

Thanks
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

HTML and CSS are saved in a single file by default.
The problem is only with images, they are saved as separate files by default.

I can suggest the following solutions

1) Use a web archive format (MHT files), containing HTML and images.
MHT files can be opened by browsers like HTML files.
You can find the example in
http://www.trichview.com/forums/viewtopic.php?t=11
(the demo in Delphi\SaveFile folder)

or

2) You can store images just inside <img src>.
The syntax is like this:

Code: Select all

<img src="data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0j
vb29t/f3//Ub//ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAA
Re8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcppV0aCcGCmTIHEIUEqjgaORCMxIC6e0Cc
guWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7">
I.e. the format is: data:[<image type>][;base64],<image data>

Process OnSaveImage2, create the proper value for <img src>, assign it to Location parameter. I think that this feature will be added (as an option) in future versions of TRichView.
Post Reply