Document Converter on Moodle 4.3

Document Converter on Moodle 4.3

by Dennis Fulton -
Number of replies: 9
Moodle 4.3
PHP 8.2
Apache2.4.57
Ubuntu 22.04

Installed Moodle 4.3 on a new VPS.  All works well except for the Document Converter.  Both Google and Unoconv work from the command line, but within Moodle Alert: Cannot open the PDF. The file may be corrupt, or in an unsupported format.

Within the plugin Google converts the test file to PDF.  But within the plugin Unoconv errors Exception - Path cannot be empty, yet it will convert from the command line.

Any thoughts would be appreciated

Average of ratings: -
In reply to Dennis Fulton

Re: Document Converter on Moodle 4.3

by Ken Task -
Picture of Particularly helpful Moodlers
File under ... 'any thoughts' ... :|

Set the path to python and ghostscript in Admin settings for 'paths'.

Mind sharing what command you used to test unoconvert?
Is it this one:
pageNum=`gs -q -dNODISPLAY -c "(./$1.pdf) (r) file runpdfbegin pdfpagecount = quit"`
gs -dNumRenderingThreads=4 -dNOPAUSE -sDEVICE=png16m -dSAFER -dDOINTERPOLATE -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dFirstPage=1 -sOutputFile=./image%d.png -r300 -q $1.pdf -c quit

Also, if poppler (pdftoppm) is installed, that is supposed to be used.

pdftoppm -png hp-unoconvtest.pdf > hp-popplertest.png

'SoS', Ken

In reply to Ken Task

Re: Document Converter on Moodle 4.3

by Dennis Fulton -
Hi Ken,

The command line I used was:  unoconv file.docx

Simple.... it converts the file to a pdf.

Works from the command line, and the google convert works in the plugin test, but neither work from a course.

I need to get this fixed before we can move off of 4.1x.

If you think of anything else let me know.

Thanks
Dennis
In reply to Dennis Fulton

Re: Document Converter on Moodle 4.3

by Ken Task -
Picture of Particularly helpful Moodlers
An Oops! Follow up ...
Hmmmm ... looks like moodle docs need an update? Depending ...


'SoS', Ken

In reply to Dennis Fulton

Re: Document Converter on Moodle 4.3

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Unoconv (bad plan) or Google (or OneDrive) convert from some random document to PDF. However, there's another step to actually display it in Moodle. You also need ghostscript or pdftoppm defined and working in System paths.
In reply to Howard Miller

Re: Document Converter on Moodle 4.3

by Dennis Fulton -
Ah... ghostscript, that was the key. Still some documents don't convert, but at least it now gives a message that you will have to down the file. Why some files convert and other don't is still a mystery.

So you would use Google over Unoconv... any concerns about privacy?
In reply to Dennis Fulton

Re: Document Converter on Moodle 4.3

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Loads - but Unoconv is useless for anything serious.
In reply to Dennis Fulton

Re: Document Converter on Moodle 4.3

by Ken Task -
Picture of Particularly helpful Moodlers
I'd use what works the most reliably.  In my experience, that would be Google.

But ... "any concerns about privacy?"   Isn't there always?

And a 'thought question' ... what sort of documents are students submitting? and is anyone sure those docs aren't generated by an AI chatbot?

My 2 cents, of course! smile
'SoS', Ken