The RTF export and import stuff

Hi all,
 Few days/weeks ago I was browsing the net and came across the RTF
Export function about Libreoffice as somebody had done the same in GSOC.

http://vmiklos.hu/blog/libreoffice

as well as http://drewjensen.typepad.com/blog/2010/12/libreoffice-33-new-features.html

I wanted to know if there are some samples RTF's which I as a user
could download and see using the various text-editors see it.

Looking forward for some samples of the same or links where such
samples can be found.

Hi :slight_smile:

I am not sure what the objective is so i have several points. Points 4 and 8
are both about security to do with malware/viruses.

1. "Rtf" is a file format similar to ".doc", ".docx", ".odt". The layout
changes a bit but it is easy to edit. File-sizes are less than most ".doc" or
".docx" often by a factor of 10 although it could be more. "Rtf" stands for
"Rich text format" and the difference between it and ".txt" is that it can hold
formatting, pictures and therefore theoretically some types of viruses such as
ones in pictures although those are extremely rare and usually ineffective
nowadays. I have never heard of an Rtf being infected although ".doc" has often
reached the mainstream press because of getting infected. Somehow MicroSquish
has successfully created FUD that makes people believe the exact oposite of
reality so most people will insist that you use ".docx" (or ".doc") or else they
complain about your formats being weird, dangerous or unreadable (they probably
wont complain to you, just to everyone you do business with). Any file in any
format when created by LibreOffice/OpenOffice or any OpenSource word-processor
is extremely unlikely to be infected by malware although they might pick-up
malware later on from other systems.

2. In most OpenSource programs you can "Save As ...", then either use the
drop-down "File Format" list at the bottom of the dialogue box or else just type
in the extension at the end of the file-name in the top-box of the dialogue
box. For example to "Save As ..." an "rft" try going up to the menus at the top

File - "Save As ..." - now give the file a name but add ".rtf" at the end of the
name

3. When you use "Save As ... " and change the format a warning message appears
saying something like "Are you sure you want to use the less safe format or keep
as ".odt"". The buttons seem to contradict the message so choose "Keep current
format" to change to the format you chose. It is confusing but try each button
in turn to see what i mean.

4. Most people use the ".doc" or ".docx" format thinking that it is safer and
better. LibreOffice/OpenOffice can use ".doc" and ".docx" so it is probably
better that we use ".doc" for most people. MicroSquish Office adds a load of
strange characters and odd personal information and information about programs
that wrote or have modified the document and some bits that were deleted from
the document. None of that can be seen when you open the document in
Word-processors (but can often be seen by text-editors). One way to avoid all
that 'bloat' is to save documents as ".rtf"s and that keeps files very much
smaller (and safer) than the ".doc" formats. LibreOffice/OpenOffice don't
include all those strange random bits of information so we might be better using
the ".doc" format so that we seem less weird to most people. Try

File - "Save As ..." and add ".doc" to the end of the file-name

5. The ".doc", ".docx" and ".rtf" (and most other) formats always look slightly
different on different machines or if you boot into a different OS on the same
machine. Various random factors such as printer settings and type of printer
affect the layout quite radically. If you want to make sure the layout looks
identical to the way you see it on your screen then try "Save As ..." ".pdf"
(=portable document format). However, then no-one can edit the document
sensibly. So, it is best to avoid "pdf" except in special cases. However you
can try

File - "Save As ... " - and add ".pdf" to the end of the file-name

6. You can also convert the document to ".pdf" in 2 other ways. You can use
the File menu to "Export to pdf". Or you can try to print the file but when the
print dialogue box appears tick the little box about half-way up the left side
that says "Print to file". In MicroSquish Office you also get this option but
it is on the right of that dialogue-box and tends to use some weird non-standard
format instead of the well-known pdf and is often a different format on
different machines. OpenSource Word-processors all tend to use "pdf" which can
then be read fairly easily (but not able to be modified (except by Gimp or other
photo-editing software)).

7. You can save almost any document as "rtf" and when anyone opens it with
almost any Word-processor it looks the same as the ".doc" or ".docx" would look
on the same machine with the same Word-processor. It keeps pictures, tables and
charts in roughly the same position relative to the text usually.

8. You can set the default format instead of using "Save As ... " all the
time. I usually change the default to the ".doc" format even though it is less
safe than the ".odt" format.

Tools - Options (at the very bottom of the menu) - "Load/Save" - General

Now near the bottom of that dialogue box see the 2 drop-downs that are
side-by-side? The first one usually says "Text document", if so then change the
2nd one by scrolling it back 1 place to "MicroSoft Word 97/2000/Xp". Also it is
worth changing the 1st box to "Spreadsheet" and then scroll the 2nd box back
upwards 2 places to "MicroSoft Excel 97/2000/Xp". Then do "Presentations" in a
similar way to spreadsheets. Now everyone receiving your documents will be
happy and believe that you are safe (except other knowledgeable
linux/mac/Bsd/unix users and a few eccentrics). You could set the default "Text
document" to "rtf" if you really want but then most people receiving your
documents will be wary and suspicious of you.

9. Quite why people believe the ".doc" and ".docx" formats are safe and other
formats are unsafe despite all evidence to the contrary is a masterpiece of FUD
spread by MicroSquish. When using MicroSquish Office when you open a non-".doc"
type format a pop-up box appears warning you that you might be opening a
non-safe document that may contain viruses or other malware. However, news
reports have often shown that various viruses or malware have been spread ONLY
by the ".doc" or ".xls" formats NEVER by "rtf"s, "odt"s or anything else.
Luckily none of them could affect linux users so you really don't need to
mention it to anyone. You can even receive infected files safely and safely
open, make changes, save and email the file off to people without even being
aware that the file is infected! This type of thing is the reason we need to do
anti-virus scans otherwise people think we pass on infected files deliberately!
Of course it does also mean we could open an infected file, "Save As ... " an
".rtf" thereby removing the virus unless it is in one of the pictures but you
can right-click on the pictures and save them out of the document and make them
safe or at least check/scan them that way. Simply using "Save As .." "rtf" is
usually all that is needed to make infected documents safe again. Even if you
find news-reports to back-up your knowledge people will see you as weird,
eccentric and dangerous if you let them know the facts. This is one example of
FUD that MicroSquish has won incontrovertibly.

I hope something here helps!
Good luck and regards from
Tom :slight_smile:

In-line :-

Hi :slight_smile:

HI Tom,
          Sorry for snipping all your stuff out but you were going
where its not needed. I already know the pros of using .rtf . That is
not the issue. Lemme tell where I'm going with this :-

In a few days from now, we would be having some conference on free
culture and knowledge and possibility of getting a booth stand where
we can show off some GNU/Linux stuff. I/We were thinking of showing
off Libreoffice (even though its at an RC stage) to people and educate
them about (somewhat alternative) file formats.

I was unaware before reading the blog and reading the work which
happened in GSOC this year that .rtf has had all those possibilities
if Microsoft hadn't abandoned it for their own reasons.

My debate is not about what they did or not. What I'm looking for is
showing off some sample ready-made .rtf's so people have an idea of
how it is and what works and how. Also would be doing some
experimentation with different text-editors both on GNU/Linux and
perhaps also on MS-Windows as to how easy or not they are to read.
Possibly many free/many open-source text-editors may show it properly
or not and then I have a chance to bug them about putting some support
in (just in case) .

I do understand the issue of .doc and .docx and the whole macro
viruses issues. I never had them but they were one of the primary
reasons for me moving away from MS in the first place.

It would be a good idea for Libreoffice in general to have some sort
of either community show-off or developers show off with example
documents which motivates people to participate more.

Hoping this makes things bit clearer for you and the community at large.
<snipped>

HI :slight_smile:

Snips are good. Staying relevant is important :slight_smile:

I think rtf is inferior to odt. The newer versions of MicroSquish Office (2007
& 2010) can both read "odt" now and odt is the one worth promoting most strongly
surely?

I can hopefully send some documents tomorrow (Thursday) when i work on the
http://www.cecf.co.uk
website. Something with pictures but no macros and in various formats? Short 1
or 2 page documents or long, research articles?

Would documents need to have been done through LibreOffice? I am still using an
older version of OpenOffice (still has the Sun logo) at the moment. I am just
waiting for the .deb to reach the Ubuntu repos or at least be easy to install.

Many regards from
Tom :slight_smile:

In-line :-

HI :slight_smile:

Hi :slight_smile:

Snips are good.  Staying relevant is important :slight_smile:

I think rtf is inferior to odt.  The newer versions of MicroSquish Office (2007
& 2010) can both read "odt" now and odt is the one worth promoting most strongly
surely?

Yes and no. Look at it from two ways, yes in MS you may be able to
read in .odt but it would same as 'using an elephant to kill an ant'
or something like that. Ironically something similar was the basis of
Openoffice.org when they started long time back.

I am looking at the biggest base and the simplest format which can be
read by as many text-editors as can be read. The .rtf format achieves
that.

If I was a small device manufacturer then also .rtf would fit the
bill. There was talk of an odf-viewer but it was highly broken the
last time I saw it ~ over 2 years ago. So just because Microsoft is
playing ball doesn't mean its good or bad. I hope you are getting my
point.

Also I don't want to be in a place to push or give a single
alternative format, that's the reason we landed on the whole
openoffice.org in the first place.

I can hopefully send some documents tomorrow (Thursday) when i work on the
http://www.cecf.co.uk
website.  Something with pictures but no macros and in various formats?  Short 1
or 2 page documents or long, research articles?

I don't know if .rtf can read macros or not. If yes, that's also
great, honestly haven't seen that. The 1 or 2 pages long is good, but
better would be probably a spreadsheet, pictures or whatever good
combos think of. I don't know if Libreoffice has a sort of community
place where user-generated content could be put up. If there is such a
place, it would be good if you put it up there and just give me the
links, this way everybody gets a chance to also use that.

Would documents need to have been done through LibreOffice?  I am still using an
older version of OpenOffice (still has the Sun logo) at the moment.  I am just
waiting for the .deb to reach the Ubuntu repos or at least be easy to install.

I don't know which version of Ubuntu you are using, I had installed it
on Ubuntu 10.10 the last time I had access to a Ubuntu 10.10 release.
Couple of places which give you how you can do it.

http://www.mydailytechtips.com/2010/10/how-to-install-libreoffice-in-ubuntu.html

http://www.ubuntugeek.com/how-to-install-libreoffice-in-ubuntu-using-deb-packages.html

The latter is the way I did it in Debian and apart from having
openoffice.org shortcut in the menus everything else works fine.

Although doing it with libreoffice would be better, then we could also
check the implementation of that, see how the .rtf gets structured and
stuff like that.

It should be fun. I would have done the same but frankly I'm not a
document guy and don't have the skills to make good-looking documents.

Many regards from
Tom :slight_smile:

<snipped>

Hi,

In-line :-

HI :slight_smile:

Hi :slight_smile:

Snips are good.  Staying relevant is important :slight_smile:

I think rtf is inferior to odt.  The newer versions of MicroSquish Office (2007
& 2010) can both read "odt" now and odt is the one worth promoting most strongly
surely?

Yes and no. Look at it from two ways, yes in MS you may be able to
read in .odt but it would same as 'using an elephant to kill an ant'
or something like that. Ironically something similar was the basis of
Openoffice.org when they started long time back.

I am looking at the biggest base and the simplest format which can be
read by as many text-editors as can be read. The .rtf format achieves
that.

Hm, in this case you should use simple text files. Any editor can read
this, for example gedit or kate on Linux and Notepad or Notepad+ on
Windows. I don't know about any editor for Mac's. But unfortunately,
with plain text, you don't have any formatting.

If I was a small device manufacturer then also .rtf would fit the
bill. There was talk of an odf-viewer but it was highly broken the
last time I saw it ~ over 2 years ago. So just because Microsoft is
playing ball doesn't mean its good or bad. I hope you are getting my
point.

Honestly, if I were a small device manufacturer, I would not want to
use rtf at all. But I guess, this depends on what kind of devices
you're talking about. :wink:

Also I don't want to be in a place to push or give a single
alternative format, that's the reason we landed on the whole
openoffice.org in the first place.

I agree, showing several alternatives is good!

I can hopefully send some documents tomorrow (Thursday) when i work on the
http://www.cecf.co.uk
website.  Something with pictures but no macros and in various formats?  Short 1
or 2 page documents or long, research articles?

I don't know if .rtf can read macros or not. If yes, that's also
great, honestly haven't seen that. The 1 or 2 pages long is good, but
better would be probably a spreadsheet, pictures or whatever good
combos think of. I don't know if Libreoffice has a sort of community
place where user-generated content could be put up. If there is such a
place, it would be good if you put it up there and just give me the
links, this way everybody gets a chance to also use that.

A suggestion: You can create an account at the wiki
(wiki.documentfoundation.org) and upload the files there. Every user
has his own page, that can be used for stuff like this.

Would documents need to have been done through LibreOffice?  I am still using an
older version of OpenOffice (still has the Sun logo) at the moment.  I am just
waiting for the .deb to reach the Ubuntu repos or at least be easy to install.

I don't know which version of Ubuntu you are using, I had installed it
on Ubuntu 10.10 the last time I had access to a Ubuntu 10.10 release.
Couple of places which give you how you can do it.

http://www.mydailytechtips.com/2010/10/how-to-install-libreoffice-in-ubuntu.html

http://www.ubuntugeek.com/how-to-install-libreoffice-in-ubuntu-using-deb-packages.html

The latter is the way I did it in Debian and apart from having
openoffice.org shortcut in the menus everything else works fine.

I think installing LibreOffice is pretty straight forward on either
rpm or deb-based distributions.

Download the file that you want to install, unpack it with your
preferred tool (unzip or e. g. ark for GUI users). If you're not on a
terminal yet, I would suggest that you go there now and change into
the directory with your deb-files. Get root-privileges (su or sudo,
what ever you prefer) and enter

dpkg -i *.deb

This installs all the files in the right order automatically. You
don't have to figure out which packet to install first, second and so
on. Install the packet for the deskopt integration in the same way
(it's in a sub folder in the debs-directory).

Same instructions apply to installing an extra language-pack (if needed).

For someone who runs a rpm-based distro, the equivalent of the above command is

rpm -Uvh *.rpm

-U means update (=delete old version and install new one)
-v verbose (tells you what it's doing)
-h uses hash signs to give you some sort of progress bar

Greetings from
Sigrid

A full RTF editor is already included in Windows since version 3.0 (at
least)... It was called Write and now it is called Wordpad.

For Windows, besides OOo and LO you can also use the lightweight AbiWord
(http://www.abisource.com/) which is a full cross-platform wordprocessor
which supports both RTF and ODF.

Finally you have the Free (but not Open Source) TextMaker Viewer from
Softmaker (http://www.officeviewers.com/) which allows to view both RTF and
ODF.

:slight_smile:

See:

http://cgit.freedesktop.org/~vmiklos/lo-test-files/tree/writer

Convert the odt files to rtf using LibreOffice, then you can do your
tests. If you want to test the rtf export itself, then sadly I can only
recommend MS Office, which is the only editor implementing 100% of the
rtf spec. (LibO got closer with the recent rework, but it's still not
100%.)

In-line :-

<snipped>

:slight_smile:

See:

http://cgit.freedesktop.org/~vmiklos/lo-test-files/tree/writer

Convert the odt files to rtf using LibreOffice, then you can do your
tests. If you want to test the rtf export itself, then sadly I can only
recommend MS Office, which is the only editor implementing 100% of the
rtf spec. (LibO got closer with the recent rework, but it's still not
100%.)

Wow, nice Miklos. Its not everyday that a developer comes up and
shares his work with us users. It would be nice if you would blog
about it sometimes, maybe tag it so somebody like me who doesn't have
any programming knowledge (and doesn't want to) can come and see what
progress is being made in that.

On the other side, what would you say would be a good strategy to push
other text-editors to use the spec. or come close to it. What they
need to look at, I can atleast ask in abiword, gedit and other
open-source text-editors even if its just as a wishlist bug. Would
need that info.

Lastly, I have just subscribed to the nomail version of the list.
While the traffic is not much now, in the coming days I do feel its
going to be big and I don't want to be distracted by other
discussions. As already said not a programmer so many things which
would be discussed may be those as well as other wishlist stuff.

Anyways, looking forward to knowing more from you.

Thank you for your time.

Wow, nice Miklos. Its not everyday that a developer comes up and
shares his work with us users. It would be nice if you would blog
about it sometimes, maybe tag it so somebody like me who doesn't have
any programming knowledge (and doesn't want to) can come and see what
progress is being made in that.

What you linked is already the list of posts tagged as 'libreoffice'. :slight_smile:

On the other side, what would you say would be a good strategy to push
other text-editors to use the spec. or come close to it. What they
need to look at, I can atleast ask in abiword, gedit and other
open-source text-editors even if its just as a wishlist bug. Would
need that info.

That may sounds too obvious: most of the spec is clear, so what a
developer of a text editor can do is really 1) read a part of the spec
2) as a reference implementation, you can have a look at what MSO does,
as long as the blackbox model it provides helps you.

Lastly, I have just subscribed to the nomail version of the list.
While the traffic is not much now, in the coming days I do feel its
going to be big and I don't want to be distracted by other
discussions. As already said not a programmer so many things which
would be discussed may be those as well as other wishlist stuff.

If you have a specific document in odt format which is not exported
properly in RTF and it is in MSO, then you are welcome to report it
following http://wiki.documentfoundation.org/BugReport and as my free
time permits, I can try to fix it up.

Unless he's following on Nabble or somewhere, Shirish (shirishag75@gmail.com) probably didn't see this -- note the reference to the nomail version.

Yes, I noticed it.. Sadly the reply-to header is tweaked on this list so
even reply-to-all (what I use on the libreoffice lists) replies to the
list only.

Sorry about that.

Hi :slight_smile:

Err people do realise that the aim of text-editors is completely different from
the aims of word-processors right?

A word-processor shows how the formatting looks but does not show up all the
special characters whereas a text-editor shows characters but does not show the
effect they may have on formatting. Text-editors are great for progamming and
stuff but not great for reports with pie-charts and pictures. Writer can save
stuff as a text-document but may have extra codes in there that might not be
obvious. Writer is an excellent word-processor.

Regards from
Tom :slight_smile:

Hi :slight_smile:

I am sorry but my plan to just attach various documents from work after using
"Save As .. " to get them into rtf format hit a slight snag. Most of the
documents ended up being larger because the hidden codes and stuff didn't get
removed. I tried creating a new document as an rtf but it still ended up having
extra characters that rtf doesn't need and the odt was about 10 times smaller!
The odt was 71.4Kb and the Rtf was 611Kb!

Sorry chap!
Regards from
Tom :slight_smile:

That's expected - rtf is optimized for portability, where size does not
matter. odt is a zipped xml, so at least size is an important aspect as
well.