[Solved] Format error while opening presentation

Discuss the presentation application
Post Reply
pmensik
Posts: 2
Joined: Sun May 15, 2022 10:36 pm

[Solved] Format error while opening presentation

Post 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 3913 times
Thanks a lot again!
Last edited by MrProgrammer on Sun Aug 07, 2022 4:10 am, edited 2 times in total.
Reason: Noted broken link
OpenOffice 4.1.11 on Elementary OS 6.1
User avatar
MrProgrammer
Moderator
Posts: 4907
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Format error while opening presentation

Post 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.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
pmensik
Posts: 2
Joined: Sun May 15, 2022 10:36 pm

Re: Format error while opening presentation

Post by pmensik »

You saved my day, thank you very much!
OpenOffice 4.1.11 on Elementary OS 6.1
Post Reply