Page 1 of 1

[Solved] Format error while opening presentation

Posted: Sun May 15, 2022 10:42 pm
by pmensik
Hello,

I've been creating a presentation for a couple of hours and saving the progress when doing so. However, when I closed the file and tried to open it again, I am getting a format error (please see the attached screenshot). I tried to unzip the file and look for the error myself but I don't see anything obvious there unfortunately. Thanks for any help, I am having the presentation tomorrow :-)
I am not allowed to attach big files so here's the link for download in case anyone wants to help https://easyupload.io/vlzg0f
 Edit: 2022-08-06 link above is broken -- MrProgrammer, forum moderator  
open_office.png
open_office.png (32 KiB) Viewed 6775 times
Thanks a lot again!

Re: Format error while opening presentation

Posted: Mon May 16, 2022 4:18 am
by MrProgrammer
Hi, and welcome to the forum.
pmensik wrote: Sun May 15, 2022 10:42 pm I tried to unzip the file and look for the error myself but I don't see anything obvious there unfortunately.
File content.xml contains draw:mirror-vertical="false" and then shortly thereafter draw:mirror-vertical="true". That is a conflict since an attribute cannot be specified twice. This duplication occurs in two places. Remove either draw:mirror-vertical="false" or draw:mirror-vertical="true". I don't know which setting is correct. Removing either should allow you to open the file so you can examine the layout. The commands I used were:

cd "LocationOfBadFile"                         # Set current directory
file='polkadot_prednaska.odp'                  # File to fix in current directory
xml=content.xml                                # Component to fix
bad='draw:mirror-vertical="true"'              # Attribute to remove
cp "$file" MrProgrammer.odp                    # Make a copy of the file
unzip -p MrProgrammer.odp $xml >bad.xml        # Extract content.xml
sed -e "s/$bad/ /g" bad.xml >$xml              # Fix it
zip -m MrProgrammer.odp $xml                   # Put repaired file back in presentation
rm bad.xml                                     # Remove extracted content

The repaired file is MrProgrammer.odp. I did the edit with sed but you could just use your favorite text editor.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the subject field. Select the green checkmark icon at the same time.

Re: Format error while opening presentation

Posted: Mon May 16, 2022 11:58 am
by pmensik
You saved my day, thank you very much!