sozi-projects/Sozi

Cannot load any SVG file created with LibreOffice Draw

aumouvantsillage opened this issue · 2 comments

Discussed in #546

Originally posted by troelsstru August 5, 2021
Hi, I installed Sozi on my new laptop, but it cannot load any svg-file :-(

Can anyone help? I am NO EXPERT (just recently learned how to use the terminal), so I'm in need of simple explanations :-)

Thanks so much! Sozi is a great program!

Here is more informaion:

I use
Ubuntu 20.04.2 LTS
Sozi release 21.08.02

When I choose an svg-file, it doesn't give me any error message, it just doesn't load.
I have tried both by clicking "open an svg file" in the desktop version of sozi, and from a terminal: "sozi test.svg". The terminal code opens the program, but not the file.

When I press F12, here is the informaion:

__dirname=/usr/lib/sozi/resources/app/src/js /usr/lib/sozi/resources/app/src/js/Storage.js:121
Using handler: Impress /usr/lib/sozi/resources/app/src/js/svg/SVGDocumentWrapper.js:182
Uncaught (in promise) TypeError: Cannot read property 'parentNode' of null

at Function.transform (/usr/lib/sozi/resources/app/src/js/svg/ImpressHandler.js:32)
at Function.fromString (/usr/lib/sozi/resources/app/src/js/svg/SVGDocumentWrapper.js:191)
at Storage.loadSVGData (/usr/lib/sozi/resources/app/src/js/Storage.js:211)
at Storage.setSVGFile (/usr/lib/sozi/resources/app/src/js/Storage.js:195)

After that, the message "DevTools failed to load SourceMap: Could not load content for file:///usr/lib/sozi/resources/app/node_modules/pdf-lib/cjs/index.js.map: ", repeated more than 100 times with different filenames. I'll be happy to post all these lines, if they are any help.

Using 64-bit Linux Mint 20.2 Cinnamon (which is based on Ubuntu 20.04.2 LTS) and I could open SVG-file without any issues. Used *.deb file to install mentioned Sozi release 21.08.02 . Also developer console at least opened with F12 without issues.

First thing to check, whether the SVG-file, you tried to open with Sozi, is healthy - try to open it with Inkscape and also with other appropriate programs. Also you can import it other graphical programs to ensure its health.

You can try to reinstall Sozi:

sudo apt-get clean #remove old packages you might have in APT cache
sudo apt purge sozi #remove Sozi completely with all global configuration
sudo apt purge --auto-remove #remove all orphan dependencies, that left after Sozi removal
sudo dpkg -i sozi_21.08.02-1627894333_amd64.deb #install Sozi again
sudo apt install -f #fix possible dependencies
sudo dpkg --configure -a #configure all packages, that possibly did not complete (this is usually done automatically, but still useful to run to ensure, all is correct. Especially useful for scripting.
sudo ldconfig #library automatic configuration, also to ensure all is correct

Certainly either run these commands in folder, you downloaded Sozi or provide appropriate path to *.deb file.
Besides, when to click just on downloaded *.deb in Ubuntu graphical file manager, then it opens GDebi, which allows to install Sozi graphically and it will solve also dependencies automatically and asks confirmation to install them. Complete uninstallation can be done also graphically, e.g. using Synaptic package manager.

You may want to also try the standalone version of Sozi (*.tar.xz), if you used *.deb, or vice versa.

Also it might be useful to check, whether e.g. updates or any other installation has been completed and no issues:

sudo ldconfig
sudo apt install -f
sudo dpkg --configure -a

Sounds like Ubuntu 20.04 LTS has still old version of Inkscape in repository. You may want to install also newest Inkscape 1.1 (currently) and create SVG-file(s) with that. There is also AppImage version available, which allows quickly check, whether the Inkscape version is the issue in your case. There is also official PPA available for newest Inkscape - so you can also add that PPA and just update your system. Actually, newest Inkscape is available via Flatpak also.

Similar issues:

@edmundlaugasson Thanks for your feedback.
In this specific case, the SVG was created with LibreOffice Draw, which is not supported at the moment.
You can find details in discussion #546