File size with TRichView

General TRichView support forum. Please post your questions here
Post Reply
tonis85
Posts: 4
Joined: Mon May 21, 2007 2:26 pm

File size with TRichView

Post by tonis85 »

My client is complaining that when they have large files, then they copy it to word and back and the file size becomes smaller.
For example I created a file, added a few pages of text, used lots of different fonts and the file was about 85k in size, when I copied the contents to word and back, the file size was about 46k. Is there something I could do so that the files would be smaller, without having to copy them to word and back.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Probably it is because of unused styles.
Call DeleteUnusedStyles when loading documents. Ideally, it should be called just before saving, but it is not desirable because it clears undo buffer.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Besides, if it is about RTF file size, please upgrade to the latest version available for registered users. It generates smaller RTF files.
tonis85
Posts: 4
Joined: Mon May 21, 2007 2:26 pm

Post by tonis85 »

Thank you for the answer

The file size problem appears when saving the rvf to a stream, we are storing them in a database.
calling DeleteUnusedStyles made the data a few kb smaller, but the file is a lot smaller when copied to word and back.

I have added examples from 2 files, this one is a part of a file created with trichview

Code: Select all

2 1 -1 1 0 0
[[V
3 1 -1 9 0 0
õ) 2 1 -1 1 0 0
plain lglase allkirja
3 1 -1 9 0 0
õ) 18 1 -1 1 0 0
plain iguslase eesnimi]]  [[V
19 1 -1 9 0 0
õ) 18 1 -1 1 0 0
plain lglase allkirja
19 1 -1 9 0 0
õ) 18 1 -1 1 0 0
plain iguslase eesnimi]]  [[V
19 1 -1 9 0 0
õ) 18 1 -1 1 0 0
plain lglase allkirja
19 1 -1 9 0 0
õ) 18 1 -1 1 0 0
plain iguslase eesnimi]]  [[V
19 1 -1 9 0 0
õ) 16 1 -1 1 0 0
plain lglase allkirja
17 1 -1 9 0 0
õ) 16 1 -1 1 0 0
plain iguslase eesnimi]]  [[V
17 1 -1 9 0 0
õ) 16 1 -1 1 0 0
plain lglase allkirja
17 1 -1 9 0 0
õ) 16 1 -1 1 0 0
plain iguslase eesnimi]]  [[V
17 1 -1 9 0 0
õ) 16 1 -1 1 0 0
plain lglase allkirja
17 1 -1 9 0 0
õ) 16 1 -1 1 0 0
plain iguslase
18 1 -1 1 0 0
 eesnimi]]  [[V
19 1 -1 9 0 0
õ) 18 1 -1 1 0 0
plain lglase allkirja
19 1 -1 9 0 0
õ) 18 1 -1 1 0 0
plain iguslase eesnimi]]  [[V
19 1 -1 9 0 0
õ) 18 1 -1 1 0 0
plain lglase allkirja
19 1 -1 9 0 0
õ) 18 1 -1 1 0 0
plain iguslase eesnimi]]   
20 1 2 0 0 0
plain 
-12 0 -1 1 0 0 21
20 1 -1 1 0 0
another version of the same file, when copied to word and then back, there aren't any numbers between words and the size of the data is smaller.

Code: Select all

[[Võplain lglase allkirjaõ
1 1 -1 1 0 0
plain iguslase eesnimi]]  [[Võplain lglase allkirjaõplain iguslase eesnimi]]  [[Võplain lglase allkirjaõplain iguslase eesnimi]]  [[Võ
4 1 -1 1 0 0
plain lglase allkirjaõplain iguslase eesnimi]]  [[Võplain lglase allkirjaõplain iguslase eesnimi]]  [[Võplain lglase allkirjaõplain iguslase
1 1 -1 1 0 0
 eesnimi]]  [[Võplain lglase allkirjaõplain iguslase eesnimi]]  [[Võplain lglase allkirjaõplain iguslase eesnimi]]   
1 1 2 0 0 0
plain 
-12 0 -1 1 0 0 1
tonis85
Posts: 4
Joined: Mon May 21, 2007 2:26 pm

Post by tonis85 »

hello again
It looks like the extra size is caused by the "õ" letters in the text. The contents saved by trichview have almost always the same numbers around that letter, but the content copied from Word doesn't have them and is considerably smaller because of that.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I can see, in the original document, "õ" character uses the text style different from other text.
In the resulting document, this character uses the same style as the rest of text.

How was this document created?
Probably the source document was loaded from RTF with RichView.RTFReadProperties.UnicodeMode = Mixed, so this character is loaded as Unicode, and the rest of text as ANSI.
tonis85
Posts: 4
Joined: Mon May 21, 2007 2:26 pm

Post by tonis85 »

Yes, that seems to be the case, that the document is loaded with UnicodeMode = Mixed.
Should it be changed to OnlyUnicode?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

It must solve this problem
Post Reply