V
V
virtustilus2013-03-15 16:06:32
Images
virtustilus, 2013-03-15 16:06:32

Convert svm image (StarView Metafile) to png?

I pulled out a lot of SVM images from the ODT documents with a PHP script (as I understand it, this is the StarView Metafile).
I can't find a way to convert these images to any other format.
Is it possible to convert it automatically somehow, even if not using PHP?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
virtustilus, 2013-03-16
@virtustilus

Found a solution.
It turns out there is an article on Habré about converting with a python script through the installed openoffice: http://habrahabr.ru/post/97637/
I didn’t read it to the end right away, as a result of which I had a lot of questions about how to run this script under OSX.
As a result, I will give a small solution to the problems, maybe it will help someone.
Download the DocumentConverter.py file from here .
The result is the following errors, in the order they are corrected:
ImportError: No module named uno.
/Applications/LibreOffice.app/Contents/MacOS/pyuno.so: mach-o, but wrong architecture
ERROR! Binary URP bridge disposed during call
Error due to invalid paths, now create a convert.sh script to run it:

#!/bin/bash


export PATH=/Applications/LibreOffice.app/Contents/MacOS:$PATH

export URE_BOOTSTRAP=vnd.sun.star.pathname:/Applications/LibreOffice.app/Contents/MacOS/fundamentalrc
export UNO_PATH=/Applications/LibreOffice.app/Contents/MacOS
export LD_LIBRARY_PATH=/Applications/LibreOffice.app/Contents/MacOS:/Applications/LibreOffice.app/Contents/ure-link/lib/
export PYTHONPATH=/Applications/LibreOffice.app/Contents/MacOS:$PYTHONPATH
PYTHON="/Applications/LibreOffice.app/Contents/MacOS/OOoPython.framework/Versions/Current/bin/python"

OFFICE="/Applications/LibreOffice.app/Contents/MacOS/soffice"


$OFFICE --norestore --nofirststartwizard --nologo --headless "--accept=socket,host=localhost,port=2002;urp;StarOffice.ServiceManager" &

sleep 5s

$PYTHON DocumentConverter.py $1 $2

Now you can convert by simply writing ./convert.sh file1.odt file2.html The svm
pictures will lie side by side in gif format.
But I went further and read the article on Habré to the end, which talked about another unoconv wrapper script. Download the sources from here http://dag.wieers.com/home-made/unoconv/#download , they contain the unoconv python script.
Now you can convert even simple svm pictures with the command
unoconv -f png mypath/*.svm

@
@ntkt, 2013-03-16
_

See what they write: ingwa2.blogspot.ru/2011/05/starview-metafiles-in-calligra.html
The SVM format didn't even have a normal specification, you can't find the means to import from it in the daytime.
Try to convert these entire ODT documents by any ready-made tool, and at least to PDF, and cut out the pictures from there.

T
t4gr1m, 2015-02-25
@t4gr1m

And I’ll throw off the link with a great delay (I had to write a tool for work), a converter plugin for Node.js
https://www.npmjs.com/package/svmconv
^_^

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question