// Document is loaded as follows
WPRichText.TextSaveFormat := 'WPT';
WPRichText.TextLoadFormat := 'WPT'; WPRichText.CPPosition := 0;
wprichtext2.TextSaveFormat := 'WPT';
wprichtext2.TextLoadFormat := 'AUTO';
wprichtext2.CPPosition := 0;
// populating the text
WPRichText.AsString; // Header, Details are populated
wprichtext2.AsString; // other details are populated
WPRichText.SelectionAsString := wprichtext2.AsString;
// Margin is set
WPRichText.Header.LeftMargin
WPRichText.Header.RightMargin
WPRichText.Header.bottomMarginc
WPRichText.Header.topMargin
// Return the complete document
result := WPRichText.AsString;
In WPRichTextRequestHTTPImage method
Graphic := TMemoryStream.Create;
//Graphic is loaded from database i.e SaveBlobDataToStream(TBlobField(qryGraphic.fieldbyname('graphic')), Graphic);.
TextObject.LoadObjFromStream('jpg',Graphic); //
TextObject.width := intWidth;
TextObject.Height := intHeight;
strGUID := URL;
TextObject.ObjRef.StreamName := strGUID;
TextObject.ObjRef.Extra := Document_GUID;
Let me know if i need to provide further inputs