Page 1 of 1

Experience with TRichViewPDF ?

Posted: Tue Dec 05, 2006 5:05 pm
by Crowbar
Hi,
i would like to produce a pdf-File from the content of RichViewEdit.
I use the TRichViewPDF - component for it of www.roledata.com.
Unfortunately, one cannot export RichViewEdit after PDF. :( Well, i load the content of the TRichViewEdit in the TRichView (see Code).

Code: Select all

...
RichViewPDF:=TRichViewPDF.Create(nil);
 try
  ms:=TMemoryStream.Create;
  try
   RechnungRichViewEdit.SaveRTFToStream(ms,false);
   ms.Position:=0;
   RichView1.Clear;
   RichView1.LoadRTFFromStream(ms);
   RichView1.Format;
   RichView1.SaveRTFToStream(ms,false);
   ms.Position:=0;
   RichViewPDF.RichView.LoadRTFFromStream(ms);
  finally
   ms.Free;
  end;
  RichViewPDF.SaveToPDFFile('C:\test.pdf');
 finally
  RichViewPDF.Free;
 end;
...
Here the result:
The contents of TRichViewEdit and TRichView are ok!
Image

The content of PDF-File is not ok!
Image

...the "paragraph background color" is wrong...
I suppose that the old "paragraph background color" is placed with the tabs.
Why? If TRichViewEdit and TRichView it correct shows!

Help ... :roll:

Crowbar

Posted: Tue Dec 05, 2006 7:10 pm
by Sergey Tkachenko
The most probably, this is a TRichView problem that was fixed in the newer version.
Open RVItem.pas, find DrawTab procedure.
In the procedure, find call of Canvas.FillRect, change the related code to

Code: Select all

  if (Canvas.Brush.Color<>clNone) and (Canvas.Brush.Style<>bsClear)  then
    Canvas.FillRect(Bounds(x, y, dli.Width, dli.Height));

Posted: Wed Dec 06, 2006 6:08 pm
by Crowbar
Thanks for your help!

Now, it works correctly! :D

Crowbar