git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@1085 0c75b7a4-871f-7646-8a2f-f78d34cc349f
42 lines
873 B
ObjectPascal
42 lines
873 B
ObjectPascal
unit funciones;
|
|
|
|
interface
|
|
|
|
function RtfToText(const Cadena: PChar): PChar; cdecl; export;
|
|
|
|
implementation
|
|
|
|
uses
|
|
Windows, Forms, Classes, SysUtils, StdCtrls, ComCtrls;
|
|
|
|
|
|
function RtfToText(const Cadena: PChar): PChar;
|
|
var
|
|
RTFConverter: TRichEdit;
|
|
MyStringStream: TStringStream;
|
|
begin
|
|
RTFConverter := TRichEdit.CreateParented(HWND_MESSAGE);
|
|
try
|
|
MyStringStream := TStringStream.Create(Cadena);
|
|
try
|
|
RTFConverter.Lines.LoadFromStream(MyStringStream);
|
|
RTFConverter.PlainText := True;
|
|
RTFConverter.WantReturns := False;
|
|
RTFConverter.WordWrap := False;
|
|
RTFConverter.Lines.StrictDelimiter := True;
|
|
RTFConverter.Lines.Delimiter := #13;
|
|
Result := PChar(RTFConverter.Lines.Text);
|
|
finally
|
|
MyStringStream.Free;
|
|
end;
|
|
finally
|
|
RTFConverter.Free;
|
|
end;
|
|
end;
|
|
|
|
end.
|
|
|
|
|
|
|
|
|