DHTMLEdit - Pre Sale Questions
Support for LoadFromStream
Thread Starter: Rael Bauer Started: 1/24/2008 2:10 AM UTC
Replies: 4
Support for LoadFromStream
Hello,

Does the htmledit have methods like LoadFromStream and SaveFromStream, to enable loading and saving to stream? Also, is it possible to Save/Load embedded images to/from this stream?

I have tried contacting you directly and have not received any reply? Previously your support has been very good so I'm wondering what has happened. Has my email address been blacklisted or something??

Rael Bauer
Re: Support for LoadFromStream
Hello Rael:

Does the htmledit have methods like LoadFromStream and SaveFromStream, to enable loading and saving to stream?

Save:
StringStream := TStringStream.Create(ProfDHTMLEdit21.Source);

Load:
ProfDHTMLEdit21.Source := StringStream.DataString;

Example:
procedure LoadFromStream(Editor: TProfDHTMLEdit2; Stream: TStream);
var
 StringStream: TStringStream;
begin
 StringStream := TStringStream.Create('');
 try
   StringStream.CopyFrom(Stream, Stream.Size);
   Editor.Source := StringStream.DataString
 finally
   StringStream.Free
 end
end;

Also, is it possible to Save/Load embedded images to/from this stream?

You can save an HTML page with a graphic as a MIME Encapsulation of Aggregate HTML Documents (MHTML) formatted string, so the graphic will be saved.

See various examples at:
http://profgrid.newsgrouphosting.com/profgrid.htmledit.support/270/Email-your-htmledit-page.html
http://profgrid.newsgrouphosting.com/profgrid.htmledit.support/666/how-to-load-MHT-files-.html
http://profgrid.newsgrouphosting.com/profgrid.htmledit.support/280/Loading-Image-from-Stream-Only-.html


-Nicholas
Re: Support for LoadFromStream
You can save an HTML page with a graphic as a MIME Encapsulation of
Aggregate HTML Documents (MHTML) formatted string, so the graphic will be
saved.

Is this the same a saving a web page as .mht?

Rael
Re: Support for LoadFromStream
Is this the same a saving a web page as .mht?

Yes.


-Nicholas
Re: Support for LoadFromStream
You can save an HTML page with a graphic as a MIME Encapsulation of
Aggregate HTML Documents (MHTML) formatted string, so the graphic will be
saved.

As I understand, ProfDHTMLEdit is built around the IE control. IE can also save as "webpage complete", so is it not possible to do this with ProfDHTMLEdit?

I would much rather prefer saving and loading in this way (as apposed to using .mht format) since this will save a significant amount of space (when saving large amount of documents), and also be significantly faster (I've just done a simple test, but for this one document, a 1,5 MB mht file, it takes a very long time to load in IE, but the "complete webpage" (i.e. with seperate image files and htm) takes alot quicker).

Thanks,
Rael