file size with rtf

General TRichView support forum. Please post your questions here
Post Reply
PKH
Posts: 4
Joined: Sun Jun 11, 2006 1:55 pm
Location: US

file size with rtf

Post by PKH »

My program lets the user generate a report with numerous embedded data charts (generated using a TeeChartPro component). The rtf file size is 2.5MB. If I paste the entire document from the TRichView component into Microsoft Word and save as a .doc file the file size is less than 100KB. My client is complaining about the rtf file size. How can I reduce it?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If these charts do not have gradients or textured backgrounds, save them in metafiles instead of bitmaps. It will give you much higher printing quality and small file size.

If you still need to use bitmaps, you can convert them to PNG (using http://pngdelphi.sourceforge.net/ ):

Code: Select all

png := TPNGObject.Create;
png.Assign(bmp);
bmp.Free;
RichView.AddPictureEx(..., png, ...).
Call RV_RegisterPngGraphic(TPngObject), and PNG will be saved to RTF as PNG. They have MUCH smaller size than bitmaps.

In the latest version (RichView v1.9.41) available for registered users, there are two new options for reducing RTF file size:
One of them allows saving bitmaps as PNG.
Another one allows saving pictures in RTF in binary mode (twice less in size, but RTF becomes a binary file).
Post Reply