Word docx file rendering incorrectly

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
zmotiwala
Posts: 46
Joined: Wed Dec 28, 2011 5:34 pm

Word docx file rendering incorrectly

Post by zmotiwala »

Attached is a Microsoft Office 2007 docx file.

This converting to a pdf incorrectly.

The heading is totally missing.

Please advise on what other property values I can set to ensure that the pdf is exported just as the original file.
Attachments
OfficeWordIntegrationSampleFile.docx
(29.36 KiB) Downloaded 426 times
Libre Office 5.2.5
Windows
User avatar
Hagar Delest
Moderator
Posts: 32667
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Word docx file rendering incorrectly

Post by Hagar Delest »

What about using MS Office?
docx has not really been designed to be compatible with anything else than MS Office.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Word docx file rendering incorrectly

Post by Villeroy »

Download and install the Microsoft WinWord viewer and a virtual PDF printer. Let the viewer print to the virtual printer.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Carlos Rocha
Posts: 3
Joined: Thu Feb 02, 2012 9:35 pm

Re: Word docx file rendering incorrectly

Post by Carlos Rocha »

Hagar Delest wrote:What about using MS Office?
docx has not really been designed to be compatible with anything else than MS Office.
True, but OpenOffice is supposed to be able to open it. Ubuntu louds it http://www.ubuntu.com/ubuntu/features/o ... plications
Anyway, your answer is not really to help or "moderate". :shock:

@zmotiwala,
I tested it and you are right. Also the OpenOffice Navigator looks strange in the headings. Maybe you should report it as a bug.
OpenOffice 3.4 on Windows 7
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Word docx file rendering incorrectly

Post by RoryOF »

Carlos Rocha wrote:
Hagar Delest wrote:What about using MS Office?
docx has not really been designed to be compatible with anything else than MS Office.
True, but OpenOffice is supposed to be able to open it. Ubuntu louds it http://www.ubuntu.com/ubuntu/features/o ... plications
Anyway, your answer is not really to help or "moderate". :shock:
If the Ubuntu reference is incorrect you should take that up with Ubuntu. In any event, that link refers to LibreOffice which has reportedly better support for some of the MS office formats; if you are using the Ubuntu distro version you should change your forum signature to reflect this, as there are differences in the different versions, which is partly the reason for their existence. No version of OpenOffice, be it Apache OpenOffice or LibreOffice (or any other, if there be such) purports to be an exact MS Office clone with exact format invariance, still less is there likely to be format invariance across operating systems.

There is an implied obligation when offering help to offer "best help", which Hagar has done. That the recipient doesn't like the advice does not void that obligation.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Hagar Delest
Moderator
Posts: 32667
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Word docx file rendering incorrectly

Post by Hagar Delest »

Carlos Rocha wrote:OpenOffice is supposed to be able to open it. Ubuntu louds it http://www.ubuntu.com/ubuntu/features/o ... plications
That's the problem when you claim something that will never be actually possible. The OOXML format has not been designed to be compatible with anything else than MS Office, period. See: MS Office 2007 OOXML file format (docx, xslx, pptx, ppsx).
Carlos Rocha wrote:Anyway, your answer is not really to help or "moderate". :shock:
The only real help for the user in such case is to use MS Office. AOO is not a free clone of MS Office. Personally, when I've to handle .doc/.docx/..., I use MS Office and that's all. The possibility of data loss because of a glitch in the import/export filters is a show stopper. Let alone the time that I would spend on re-formatting the documents.
The user is just facing the vendor lock-in policy that allowed MS Office to be a widely spread format: let the application be pirated too, so that all the users use the MS Office file formats and they are trapped. That's why true open standards is a key point for the future.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Carlos Rocha
Posts: 3
Joined: Thu Feb 02, 2012 9:35 pm

Re: Word docx file rendering incorrectly

Post by Carlos Rocha »

Guys,

zmotiwala is trying to use OpenOffice/LibreOffice to get rid of MSOffice. Telling him to keep using MSOffice is not of any help, for him or for OpenOffice. You should be glad (as I am) when someone tries to move away from MSOffice, and try to be as helpful as possible to allow the move.

I'm with OpenOffice since the very beggining, by the time of Star Division, and it always tried to open and save MSOffice documents in the best possible way, so the reported issue is definitely a bug.
OpenOffice 3.4 on Windows 7
User avatar
Hagar Delest
Moderator
Posts: 32667
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Word docx file rendering incorrectly

Post by Hagar Delest »

I can understand the need to read MS Office format.
But saving in MS Office format will not help the spread of ODF. The problem nowadays is proprietary formats like .doc/.docx. They are not suitable for interoperability. If you make applications that can save in such formats, do you believe that users will bother using something else like ODF?
The key point is not AOO or MSO, it's the file format. If MSO is a better application for the same format quality, then why not using it? We are not against MS Office by basic ideology.

At work, I would lose too much time to make sure that my files in MS Office formats are correctly rendered. I just can't agree with that. So I use AOO only for documents that I don't need to share with non AOO users.
Remember that users want something for real work, where time is money and where you can't lose time for such issues (I'm not talking about the few letters you have to print at home for personal things). In such case, perhaps the cost of MS Office is not that insignificant but in the long run, it's worth the time saving (and the troubles).
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
zmotiwala
Posts: 46
Joined: Wed Dec 28, 2011 5:34 pm

Re: Word docx file rendering incorrectly

Post by zmotiwala »

Hello ,
The customer uses Microsoft Office 2007 to create these documents so I cannot control that. We need to convert these to a pdf file so it can be viewed in our web application. Open Office is wonderful and lets me do it.
The debate here is not whether I should use OO or MS Office. I am simply looking for a way to transfer over everything in my docx file to a pdf. I was hoping open office let me do that.

Open office has rich filter settings and I was wondering if there is something I could use to fix this issue.

So if you'll have any ideas that would help I would appreciate it.

Thank you!
Libre Office 5.2.5
Windows
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Word docx file rendering incorrectly

Post by Villeroy »

It is technically impossible that any non-MS software will ever process this pestilence of a file format as perfectly as MS can do. This is the first reason why Microsoft bribed OOXML through the standardization boards. Second reason was fighting the ODF standard with something that has "Open", "Office" and "XML" in the name.

You need a software which is able to render any docx you throw at it perfectly well. This is the WinWord viewer which is downloadable for no money from the Microsoft Office site.
Secondly you need a virtual PDF printer which is a software that behaves like a physical printer and prints everything you throw at it into a PDF file instead of a sheet of paper. There are plenty of PDF printers availlable for the Microsoft Windows environment.
Finally you may even write a simple script which calls WordViewer.exe with a printer parameter for each *.docx in a given directory.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
ithinktfiam
Posts: 3
Joined: Mon Jan 28, 2013 9:15 pm

Re: Word docx file rendering incorrectly

Post by ithinktfiam »

There is no use flaming at "this pestilence of a file format." It is what MS uses and so what many companies use. Last computer I bought, five years ago, I tried OpenOffice and it didn't read MS well. I just bought a new rig and thought I'd try it again, yet in 2013 there's no save for docx in the basic save screen.

I work requires it, things I share between home and office therefore need it. It's sad when I come to the forums to find if there's any way to save to docx, even for simple files, and all I find is reasons why I can't use OpenOffice.
Windows 7, OpenOffice 3.1.0
User avatar
Hagar Delest
Moderator
Posts: 32667
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Word docx file rendering incorrectly

Post by Hagar Delest »

ithinktfiam wrote:There is no use flaming at "this pestilence of a file format."
But users need to be aware of that vendor lock-in policy!
If you need to use .docx, then use MS Office and that's all. This file format has not been designed to be compatible with anything else than MS Office. What do you think? That they will allow users to use another office suite so easily? But who would buy MS Office then?

The problem is in the file format itself, not in AOO able to save or not in OOXML!
That's why ODF has been created.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Post Reply