trying to save in HTML like this
Code: Select all
rve.SaveHTMLToStreamEx(ss,'','','','','','', [rvsoUTF8,rvsoUseCheckpointsNames, rvsoUseItemImageFileNames]);
Code: Select all
<p>ПРивет</p>
Regards,
Code: Select all
rve.SaveHTMLToStreamEx(ss,'','','','','','', [rvsoUTF8,rvsoUseCheckpointsNames, rvsoUseItemImageFileNames]);
Code: Select all
<p>ПРивет</p>
Code: Select all
procedure TTestsRvePanel.UpdateHTMLContenInDB;
var htmlContent:string;
ss:TStringStream;
begin
if rve.Visible then begin
ss:=TStringStream.Create;
try
ss.Position:=0;
rve.DeleteUnusedStyles(True, True, True);
rve.ClearUndo;
rve.SaveHTMLToStreamEx(ss,'','','','','','', [rvsoUTF8,rvsoUseCheckpointsNames, rvsoUseItemImageFileNames]);
htmlContent:=ss.DataString;
finally
ss.Free;
end;
end else if Memo.Visible then htmlContent:=memo.Lines.Text;
//update HTML content in descendants
if Assigned(FOnUpdateHTMLContent) then FOnUpdateHTMLContent(htmlContent);
end;
Code: Select all
procedure TTestsRvePanelQuestion.LoadHTMLContentFromDB();
var myOwner:TTestsMF;
tempDir: string;
randomFilePath: string;
qSelectHTMLContent:TFDquery;
clientTempDir: string;
//RVHTMLViewImporter:TRVHTMLViewImporter;
addEditForm:TTestsAddEditForm;
begin
myOwner:=(Self.Owner.Owner.Owner as TTestsMF);
addEditForm:=(Self.Owner as TTestsAddEditForm);
qSelectHTMLContent:=TFDquery.Create(Self);
try
with qSelectHTMLContent do begin
Connection:=myOwner.FDConnection_ExternalConnect;
qSelectHTMLContent.SQL.Text:='SELECT * FROM database.testquestions where id=:id';
Params.ParamValues['id']:=addEditForm.questionID;// FQuestionID;
Disconnect(); Open;
Memo.Lines.Text:=FieldByName('htmlContent').AsString;
Close;
//filling rve from temp file
try
tempDir:=ExtractFilePath(Application.ExeName)+'files\temp';
TDirectory.CreateDirectory(tempDir);
randomFilePath:=tempDir+'\'+ inttostr(Random(1000000))+'.html';
Memo.Lines.SaveToFile(randomFilePath);
RVAControlPanel.InitImportPictures(nil, nil);
rve.OnImportPicture := RVAControlPanel.DoImportPicture;
RVHTMLViewImporter.LoadFromFile(randomFilePath,rve);
RVAControlPanel.DoneImportPictures;
rve.OnImportPicture := nil;
//RvHtmlImporter.LoadHtml(randomFilePath);
rve.FormatAll;
finally
if TFile.Exists(randomFilePath) then
TFile.Delete(randomFilePath);
end;
end;
finally
qSelectHTMLContent.Free;
end;
end;
Code: Select all
ss := TStringStream.Create('', TEncoding.UTF8)