Document Converter on Moodle 4.3

Document Converter on Moodle 4.3

Dennis Fulton -
Atsakymų skaičius: 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

Pažymių vidurkis: -
Atsakymas į Dennis Fulton

Re: Document Converter on Moodle 4.3

Ken Task -
Particularly helpful Moodlers paveikslėlis
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

Atsakymas į Ken Task

Re: Document Converter on Moodle 4.3

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
Atsakymas į Dennis Fulton

Re: Document Converter on Moodle 4.3

Ken Task -
Particularly helpful Moodlers paveikslėlis
An Oops! Follow up ...
Hmmmm ... looks like moodle docs need an update? Depending ...


'SoS', Ken

Atsakymas į Dennis Fulton

Re: Document Converter on Moodle 4.3

Howard Miller -
Core developers paveikslėlis Documentation writers paveikslėlis Particularly helpful Moodlers paveikslėlis Peer reviewers paveikslėlis Plugin developers paveikslėlis
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.
Atsakymas į Howard Miller

Re: Document Converter on Moodle 4.3

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?
Atsakymas į Dennis Fulton

Re: Document Converter on Moodle 4.3

Ken Task -
Particularly helpful Moodlers paveikslėlis
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! besišypsantis
'SoS', Ken