lpaulsen93 / dokuwiki-plugin-odt

Exports a page to the Open Document format used by OpenOffice.org and other word processors
http://www.dokuwiki.org/plugin:odt
13 stars 26 forks source link

"Unreadable content found - Want to restore this document?" Bug help #133

Open withdefiance opened 8 years ago

withdefiance commented 8 years ago

I've just also posted something on the DW2PDF forum, I hope you can also help me out with the following.With my basic knowledge I try to build and run a new website. The idea is to post texts and books and to make it possible for people to run them as both PDF and text to also make them readable, editable, publishable etc.

When I for instance try to run it on this: http://anarchisme.nl/doku.php?id=namespace:abc_van_het_anarchisme the ODT plugin seems to work. But when I open the document, it first renders that it has an issue with the content. Then when running the restoration-proposition it just opens the file fine. Do you have any idea what the issue might be?

Thanks for your time.

Tommy

lpaulsen93 commented 8 years ago

I did try to export the page from the link two times and open it directly and it worked fine without any problems.

Can it be that your problems are caused by a slow connection or something? Or a operating system problem?

I know that under windows opening a document sometimes does not work the first time if something is too slow (e.g. harddisk busy).

I use Ubuntu Linux, no problem so far.

withdefiance commented 8 years ago

Hey Lars, thanks for your swift reply. I use Microsoft Windows 7 (64 bit) and Microsoft Office 2013. It doesn't matter if I do 'open directly' or 'save as', both give the same problem.

If I click 'details' at the error message it says the file is damaged and cannot be opened. When clicking OK, it prompts that the file has 'unreadable content' after which it offers to restore the file (which works).

lpaulsen93 commented 8 years ago

Ok, I see the table following the text "De cijfers van de laatste acht jaar luiden als volgt: " is not displayed correctly in LibreOffice after export. Maybe the problem is in that section. But LibreOffice doesn't complain about anything when opening the exported ODT file.

lpaulsen93 commented 8 years ago

I think I found the problem maybe. You used the wrap plugin to put the table in a gray box.

This might cause a problem because the wrap box will be converted to an ODT frame/text box but inside a frame/text box no tables are allowed.

Can you please test if the problem dissapears if you just use a normal table (without wrap)?

lpaulsen93 commented 8 years ago

If the wrapped table is the problem then I guess there will be no solution right now which would make it work using the wrap plugin.

But alternatively you might want to use the exttab3 plugin to create the table. You could use the following code to create your table with exttab3 plugin:

{| style="margin: auto; width: 75%;"
! style="width: 50%; background-color: whitesmoke; border: 1pt solid  whitesmoke; padding: 0em 0.5em;"| Resultaten ten gunste van de arbeidende bevolking
! style="width: 50%; background-color: whitesmoke; border: 1pt solid  whitesmoke; padding: 0em 0.5em;"| Resultaten ten gunste van de werkgevers
|-
| style="border: 1px solid  whitesmoke; background-color: whitesmoke; padding-left: 2em;" |
  * **1920**     390
  * **1921**     152
  * **1922**     111
  * **1923**     187
  * **1924**     163
  * **1925**     154
  * **1926**     67
  * **1927**     61

| style="border: 1px solid  whitesmoke; background-color: whitesmoke; padding-left: 2em;" |
  * 507
  * 315
  * 222
  * 183
  * 235
  * 189
  * 126
  * 118

|}

Please let me know what your test results are and if this could be a suitable workaround.

withdefiance commented 8 years ago

Had a day without a chance to respond. I checked some stuff but with no results yet. I didn't use the 'table' though, so i'm going to check if this might be it.

I also thought it might be something with Microsoft Office. I'm going to install libre office and see the results, check with Microsoft (report a bug) see results. I'll get back to you soon on this.

lpaulsen93 commented 8 years ago

To be more clear about the table: I checked the ODT specification and it is definitely not allowed inside of a frame. So this is clearly a bug in the ODT plugin. But there is currently no solution to have a table inside of a frame working. So you can say the ODT plugin works as expected but wrap support for boxes is limited.

Both Microsoft Office and LibreOffice notice the invalid content but behave differently:

I think the only solution right now is to use a simple table (not very beautiful) or an exttab3 table if you want to use ODT export.

But anyway it would be nice if you can check if the table is the only problem. I cannot check myself because I do not have Microsoft Office installed.

As far as I noticed the table is the only part missing in LibreOffice.

I will mark this issue with a bug label but also with a wontfix label because as mentioned above there will be no solution to make wrap boxes and ODT plugin working in the way you used it (but that is a issue with the ODT plugin and NOT your fault of course).

lpaulsen93 commented 7 years ago

I noticed that your page is still online. I tested the ODT export and the problem is still there - of cource.

Then I copied the content of your page onto my private DokuWiki and exported it to ODT. The table was there and it seems to be OK on a first quick view.

If you like and if you got time for it please re-test your export with the following plugin versions:

I have placed a pull-request for the wrap plugin but it has not been merged yet. So if you like to test you need to manually install my fork. The changes are only related to the ODT export. I did not change anything in the wrap plugin that has to do with the XHTML browser view.