WPCubed Product Support

File size before save

How can I know the file size a TWPCustomRtfEdit will create before it is saved to file?

#1 ♥ 0
3.9k Views 2 users read 1 min

Found

ceil((Length(WPRichText1.AsString)/ 1024)

works fine for KBs

Thanks

#2 ♥ 0
support

Hi,

using a TMemoryStream with SaveToStream avoids some overhead. You can then use MemoryStream.SaveToFile to save it after you have checked the size.

Regards,

Julian Ziersch

#3 ♥ 0
This category is archived. No new posts are possible.