Improvement to TfrxHTMLView

TfrxHTMLView is a great addition to the VCL reporting tool!

Can I suggest you add a HTML paste function to the source editor for the TfrxHTMLView

This would make this feature MUCH more useful

//Basically like this

var

 CF_HTML: Word;

 Data: THandle;

 Ptr: Pointer;

 Error: DWORD;

 Size: NativeUInt;

 utf8: UTF8String;

 Html: string;

begin


 CF_HTML := RegisterClipboardFormat('HTML Format');


 Clipboard.Open;

 try

  Data := Clipboard.GetAsHandle(CF_HTML);

  if Data=0 then begin

   Writeln('HTML data not found on clipboard');

   Exit;

  end;


  Ptr := GlobalLock(Data);

  if not Assigned(Ptr) then begin

   Error := GetLastError;

   Writeln('GlobalLock failed: ' + SysErrorMessage(Error));

   Exit;

  end;

  try

   Size := GlobalSize(Data);

   if Size=0 then begin

    Error := GetLastError;

    Writeln('GlobalSize failed: ' + SysErrorMessage(Error));

    Exit;

   end;


   SetString(utf8, PAnsiChar(Ptr), Size - 1);

   Html := string(utf8);


  finally

   GlobalUnlock(Data);

  end;

 finally

  Clipboard.Close;

 end;

end;

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.