file size with rtf
file size with rtf
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?
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
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/ ):
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).
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, ...).
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).