Experience with TRichViewPDF ?

General TRichView support forum. Please post your questions here
Post Reply
Crowbar
Posts: 82
Joined: Wed Oct 11, 2006 8:54 pm
Location: Germany

Experience with TRichViewPDF ?

Post 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
Sergey Tkachenko
Site Admin
Posts: 17564
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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));
Crowbar
Posts: 82
Joined: Wed Oct 11, 2006 8:54 pm
Location: Germany

Post by Crowbar »

Thanks for your help!

Now, it works correctly! :D

Crowbar
Post Reply