.doc extension document opens in libreoffice but loses content and formatting in MS WORD

Primary Teacher.doc (53.9 KB)
I converted a PDF file to doc using libreoffice headless command in ubuntu 20 . It Opens correctly in libreoffice but when i open it on MS word it file contents change to some abnormal text.

ajlittoz removed base tag as question has nothing to do with databases; even writer is dubious as the problem is liable to occur with any component of LO. So common was left though it supersedes writer which is OP’s immediate concern.

Obviously this didn’t work… as above was found only a pdf in disguise of a .doc extension.
Maybe your command was not correct?

Your document is not a .doc formatted file. It is still a PDF one. As such, LO opens it in Draw.

The only way I know to convert a PDF into some editable format is to proceed manually copying from some PDF viewer and pasting into Writer, Word or Idontknowwhat. Then you have a big manual job to rebuild paragraphs, headings, … and to restyle/reformat the text.

if it’s pdf , how can i able to edit it and why it shows file type as .doc in windows OS.

A PDF is considered a graphics file by LO. Consequently, you can edit it as you would any drawing. In Draw, basic shapes are boxes which can be labelled with a string. A PDF is seen as a collection of boxes.

Windows is an “extension-driven” OS. Your file is named .doc. Then Windows shows the icon corresponding to .doc and launches Word which ultimately reads the contents and can’t use it => strange characters instead of reporting failure.
Linux (Ubuntu) is a smarter OS. Though it has a dictionary of extensions, it usually reads some bit at the beginning of a file and matches signatures in the contents to decide which type the file really is.

1 Like

Thanks Mate ! Cheers