Bug 82033 - FILESAVE: RTF - File size is large and has problems opening in Word
Summary: FILESAVE: RTF - File size is large and has problems opening in Word
Status: RESOLVED DUPLICATE of bug 104288
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.4.6 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:rtf
: 88407 (view as bug list)
Depends on:
Blocks: RTF RTF-Corrupted
  Show dependency treegraph
 
Reported: 2014-08-02 01:17 UTC by Yousuf Philips (jay) (retired)
Modified: 2023-11-06 08:45 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
The example file in Word and the RTF-version in Writer master (767.78 KB, image/png)
2022-01-28 00:05 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2014-08-02 01:17:06 UTC
When exporting an RTF file from attachment 103815 [details], it is way to large in comparison to other applications.

Kingsoft  :   6.0 mb
OOo 3.3   :  48.9 mb
Word 2013 :  81.1 mb
Word 2007 : 108.9 mb
LibO 3.6  : 168.5 mb
LibO 4.1  : 174.5 mb
LibO 4.3  : 169.0 mb

Also opening the 4.3.1 exported RTF in word 2013 will halt it (i let it run for 10 minutes before cancelling it). Compare this with the RTF from OOo 3.3 loading in Word 2013 in 5 seconds.
Comment 1 Yousuf Philips (jay) (retired) 2014-08-02 01:23:37 UTC
forgot to include LibO 3.3.0.

LibO 3.3  :  59.2 mb
Comment 2 Yousuf Philips (jay) (retired) 2014-08-02 02:15:10 UTC
After further testing, i see that the 3.3.0 export was so small because it only exported the first 4 pages.
Comment 3 Kevin Suo 2014-08-02 06:21:29 UTC
I confirm when export as RTF with 4.3.0.4, it's 177.2 MB.
Comment 4 Matthew Francis 2015-01-18 07:55:35 UTC
*** Bug 88407 has been marked as a duplicate of this bug. ***
Comment 5 robert 2015-04-14 08:58:31 UTC
One of the problems with saving RTF files is the fact that common data is not factored out.

Here is the first part of a z/OS generated RTF file

+------+------+------+----------+---------+-------+--------+--------+--------+-------+\par
| }{\b Trip}{ |   }{\b #D}{ |   }{\b #R}{ |       }{\b KM}{ |    }{\b Time}{ |    }{\b V=}{ |   }
{\b Qual}{ |     }{\b D=}{ |     }{\b R=}{ |   }{\b R/D}{ |\par
+------+------+------+----------+---------+-------+--------+--------+--------+-------+\par
|    1 |   12 |   47 |   2981.2 |   33.44 |  88.4 |  27561 |  248.4 |   63.4 |  3.92 |\par
|    2 |   20 |}{\b    98}{ |   7901.6 |   95.29 |  82.8 |  39367 |  395.1 |   80.6 |  4.90 |\par
|    3 |    7 |   25 |   2782.6 |   31.53 |  87.3 |  44407 |  397.5 |  111.3 |  3.57 |\par
|    4 |   13 |   43 |   6406.4 |   76.25 |  83.8 |  53804 |  492.8 |  149.0 |  3.31 |\par
|    5 |    5 |   39 |   2832.6 |   30.42 |  92.3 |  58973 |  566.5 |   72.6 |  7.80 |\par
|    6 |   13 |   56 |   8529.9 |   93.34 |  91.2 |  73703 |  656.1 |  152.3 |  4.31 |\par
|    7 |    7 |   20 |   5903.7 |   60.51 |  97.0 | 110465 |  843.4 |}{\b   295.2}{ |  2.86 |\par
|    8 |    2 |   10 |   1951.7 |   21.01 |  92.9 | 108746 |  975.9 |  195.2 |  5.00 |\par
|    9 |   11 |   41 |   8152.8 |   86.08 |  94.7 |  88975 |  741.2 |  198.8 |  3.73 |\par
|   10 |    8 |   28 |   6528.1 |   63.55 | 102.1 | 107155 |  816.0 |  233.1 |  3.50 |\par
|   11 |}{\b    21}{ |   67 |}{\b   12957.5}{ |}{\b   144.37}{ |  89.6 |  72613 |  617.0 |  193.4 |  3.19 |\par

The equivalent of a LO (W7, V4.4.2.2) saved RTF file looks like, shudder and cry:

+------+------+------+----------+---------+-------+--------+--------+--------+-------+}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
| }{\b\rtlch \ltrch\loch\fs16\loch\f5
Trip}{\rtlch \ltrch\loch\fs16\loch\f5
 |   }{\b\rtlch \ltrch\loch\fs16\loch\f5
#D}{\rtlch \ltrch\loch\fs16\loch\f5
 |   }{\b\rtlch \ltrch\loch\fs16\loch\f5
#R}{\rtlch \ltrch\loch\fs16\loch\f5
 |       }{\b\rtlch \ltrch\loch\fs16\loch\f5
KM}{\rtlch \ltrch\loch\fs16\loch\f5
 |    }{\b\rtlch \ltrch\loch\fs16\loch\f5
Time}{\rtlch \ltrch\loch\fs16\loch\f5
 |    }{\b\rtlch \ltrch\loch\fs16\loch\f5
V=}{\rtlch \ltrch\loch\fs16\loch\f5
 |   }{\b\rtlch \ltrch\loch\fs16\loch\f5
Qual}{\rtlch \ltrch\loch\fs16\loch\f5
 |     }{\b\rtlch \ltrch\loch\fs16\loch\f5
D=}{\rtlch \ltrch\loch\fs16\loch\f5
 |     }{\b\rtlch \ltrch\loch\fs16\loch\f5
R=}{\rtlch \ltrch\loch\fs16\loch\f5
 |   }{\b\rtlch \ltrch\loch\fs16\loch\f5
R/D}{\rtlch \ltrch\loch\fs16\loch\f5
 |}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
+------+------+------+----------+---------+-------+--------+--------+--------+-------+}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
|    1 |   12 |   47 |   2981.2 |   33.44 |  88.4 |  27561 |  248.4 |   63.4 |  3.92 |}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
|    2 |   20 |}{\b\rtlch \ltrch\loch\fs16\loch\f5
   98}{\rtlch \ltrch\loch\fs16\loch\f5
 |   7901.6 |   95.29 |  82.8 |  39367 |  395.1 |   80.6 |  4.90 |}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
|    3 |    7 |   25 |   2782.6 |   31.53 |  87.3 |  44407 |  397.5 |  111.3 |  3.57 |}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
|    4 |   13 |   43 |   6406.4 |   76.25 |  83.8 |  53804 |  492.8 |  149.0 |  3.31 |}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
|    5 |    5 |   39 |   2832.6 |   30.42 |  92.3 |  58973 |  566.5 |   72.6 |  7.80 |}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
|    6 |   13 |   56 |   8529.9 |   93.34 |  91.2 |  73703 |  656.1 |  152.3 |  4.31 |}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
|    7 |    7 |   20 |   5903.7 |   60.51 |  97.0 | 110465 |  843.4 |}{\b\rtlch \ltrch\loch\fs16\loch\f5
  295.2}{\rtlch \ltrch\loch\fs16\loch\f5
 |  2.86 |}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
|    8 |    2 |   10 |   1951.7 |   21.01 |  92.9 | 108746 |  975.9 |  195.2 |  5.00 |}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
|    9 |   11 |   41 |   8152.8 |   86.08 |  94.7 |  88975 |  741.2 |  198.8 |  3.73 |}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
|   10 |    8 |   28 |   6528.1 |   63.55 | 102.1 | 107155 |  816.0 |  233.1 |  3.50 |}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5
|   11 |}{\b\rtlch \ltrch\loch\fs16\loch\f5
   21}{\rtlch \ltrch\loch\fs16\loch\f5
 |   67 |}{\b\rtlch \ltrch\loch\fs16\loch\f5
  12957.5}{\rtlch \ltrch\loch\fs16\loch\f5
 |}{\b\rtlch \ltrch\loch\fs16\loch\f5
  144.37}{\rtlch \ltrch\loch\fs16\loch\f5
 |  89.6 |  72613 |  617.0 |  193.4 |  3.19 |}
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af9\langfe2052\dbch\af7\afs24\alang1081\loch\f3\fs24\lang2057\sl-160\slmult0{\rtlch \ltrch\loch\fs16\loch\f5

Do we really need all this crap, like repeated font and font-size changes? And if we do, why isn't it a document-wide setting outside the {}

z/OS generated file:   376,991 bytes
Writer saved file  : 1,402,484 bytes (just a "Save As", no editing whatsoever)
Comment 6 Robinson Tryon (qubit) 2015-12-10 01:11:35 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2017-01-03 19:40:23 UTC Comment hidden (obsolete)
Comment 8 Yousuf Philips (jay) (retired) 2017-10-23 10:26:37 UTC
So here are some additional results

LibO 3.3  :  59.2 mb
LibO 3.4  : 183.8 mb
LibO 4.4+ : 124.8 mb

Word 2010 isn't able to open up the rtf produced by 4.4 and above.
Comment 9 QA Administrators 2018-10-24 02:56:53 UTC Comment hidden (obsolete)
Comment 10 Buovjaga 2019-04-18 17:49:21 UTC
(In reply to Yousuf Philips (jay) (retired) from comment #8)
> LibO 4.4+ : 124.8 mb

Still the same size.

Arch Linux 64-bit
Version: 6.3.0.0.alpha0+
Build ID: 1fee3f1da6291bfbcd75455512726215d41b3e83
CPU threads: 8; OS: Linux 5.0; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 18 April 2019
Comment 11 QA Administrators 2021-04-18 03:48:51 UTC Comment hidden (obsolete)
Comment 12 Gabor Kelemen (allotropia) 2022-01-28 00:05:43 UTC
Created attachment 177856 [details]
The example file in Word and the RTF-version in Writer master

Still a problem in:

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: eb69767d7c1bb8e6e780fd9503f08c9d7f5ecb45
CPU threads: 13; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded

Likely the same issue as bug 101170

Another issue pictured here: Top and Bottom crop values are not exported to RTF, so the image looks distorted as well.
Comment 13 Gabor Kelemen (allotropia) 2023-11-06 08:45:37 UTC
Seems to be much better now after 

tdf#104288: rtf export: drop \nonshppict on export

Original docx file size: 1.08 MB (1,132,884 Bytes)
Saved RTF file size: 2.69 MB (2,820,982 Bytes)

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a09b59cdbde2ab92bbbb6737337b74a7a62b17f1
CPU threads: 15; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded

Crop settings are still lost as noted in comment #12, adding relevant separate bug 134843 to see also.

*** This bug has been marked as a duplicate of bug 104288 ***