Unoconv in 3.9

Unoconv in 3.9

by Dennis Fulton -
Number of replies: 6

Has anyone been able to get unoconv document converter working in 3.9?  I have upgraded to CentOS 8 to get the PHP and MariaDB versions upgraded so I can install 3.9.  3.9 is running but I can't get unoconv working.  

Average of ratings: -
In reply to Dennis Fulton

Re: Unoconv in 3.9

by Ken Task -
Picture of Particularly helpful Moodlers

To get that working ...

unoconv is a python script.   Version of unoconv?

Python version?

That calls libreoffice in a headless mode ... so libreoffice installed and version?

For it to work in headless mode, a listener has to be created ... have you created a listener?

Any and all above have means of testing ... each piece.  Have you done any testing?   Beginning with Unoconv through the listerner - following that path?

I take it you have read:

https://docs.moodle.org/39/en/Universal_Office_Converter_(unoconv)#CentOS_.2F_RedHat

Modifier here might be CentOS 8 itself ... which is fairly new.

Is seLinux still there and enforcing?

'SoS', Ken


In reply to Ken Task

Re: Unoconv in 3.9

by Dennis Fulton -
Centos 8 with Python3, LibreOffice 6.4, PHP 7.4, unoconv 0.9
Was working on CentOS 7 and Moodle 3.8
In reply to Dennis Fulton

Re: Unoconv in 3.9

by Ken Task -
Picture of Particularly helpful Moodlers

Ok, that covers versions and the fact it used to work with CentOS 7 and 3.8 ...  that was then ... this is now! smile

Focus  .... what have you done to test other than the 'test' link in Moodle code?

Listener set up?

Debug says what ... if anything?

Something outside of Moodle that might help:

https://sos.sosoftexas.org/scripts/uno_ghost/unoghosts.zip

Download zip to server in some test directory on the server.

Unzip ... read the 00-READMEFIRST.txt file.

Don't have CentOS 8 anywhere yet ... BTW, you did not have to use CentOS 8 to get higher versions of PHP nor MariaDB etc.  Reputable 3 part repos do supply what's needed ... epel, remi, webtatic, mysql's own repo, etc. 

https://www.cyberciti.biz/faq/how-to-enable-and-install-epel-repo-on-centos-8-x/

Not sayin' start over ... but will say that compared to many folks in these community forums (including myself) you are on 'leading edge' (at present 'bleeding edge' [a little] :\)

'SoS', Ken

In reply to Ken Task

Re: Unoconv in 3.9

by Dennis Fulton -

Got going.  The issue was that the script was calling for /usr/bin/python which doesn't exist since I have python3.  So I added a symbolic link from python to python3.  It is now happy.

Thanks your for your help!!

Dennis

In reply to Dennis Fulton

Re: Unoconv in 3.9

by Ken Task -
Picture of Particularly helpful Moodlers

Ok, CentOS 8 from a VB image from osboxes ... installed just today.

Moodle 3.9.x installed via git just today.

Unoconv successfully installed and converted docx -> PDF both scripts provided you for testing and via 3.9 after setting up.

Installed python3 ...  in unoconv had to change first line - the shebang! line
from
#!/usr/bin/env python
to
#!/usr/bin/env python3
because I had installed python3 - in CentOS 8 repos there are python2 and python3

LibreOffice I tried to install minimal ...
dnf install libreoffice-data.noarch \
libreoffice-core.x86_64 \
libreoffice-help-en.x86_64 \
libreoffice-draw.x86_64 \
libreoffice-pyuno.x86_64 \
libreoffice-calc.x86_64 \
libreoffice-pdfimport.x86_64 \
libreoffice-impress.x86_64 \
libreoffice-math.x86_64 \
libreoffice-writer.x86_64 \
libreoffice-graphicfilter.x86_64 \
libreoffice-ure.x86_64 \
libreoffice-ure-common.noarch \
libreoffice-filters.x86_64

601 Meg

but it also installed libraries ... bunch of space.

Acquired the uno_ghost test files from sos.sosoftexas.org.

Ran the bench scripts contained there in.

./uno-bench hp-unoconvtest.docx

What that outputs might help you trouble shoot.

Script did complete successfully - clip below ...
.....

Selected output format: Portable Document Format [.pdf]
Selected office filter: writer_pdf_Export
Used doctype: document
Output file: file:///var/www/html/uno_go_test/hp-unoconvtest.pdf
DEBUG: Terminating LibreOffice instance.
DEBUG: Waiting for LibreOffice instance to exit.
[root@osboxes uno_go_test]# ls -l hp-unoconvtest.pdf
-rw-r--r--. 1 root root 13070 Jun 19 20:10 hp-unoconvtest.pdf

Set up the listener as per docs:

https://docs.moodle.org/39/en/Universal_Office_Converter_(unoconv)#CentOS_.2F_RedHat

Stepped through Admin interface set up for document conversions

and the path to unoconv ... test path OK
And downloaded the converted.pdf test file.

So ... doable for sure.

'SoS', Ken


In reply to Dennis Fulton

Re: Unoconv in 3.9

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I have unoconv 0.8.2 working just fine with Moodle 3.9, Centos 7, mysql 5.6.47, php 7.2.2, and SeLinux set to enforce, so it can be done.