Document Converter on Moodle 4.3

Document Converter on Moodle 4.3

- Dennis Fulton の投稿
返信数: 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

Dennis Fulton への返信

Re: Document Converter on Moodle 4.3

- Ken Task の投稿
画像 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

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
Dennis Fulton への返信

Re: Document Converter on Moodle 4.3

- Ken Task の投稿
画像 Particularly helpful Moodlers
An Oops! Follow up ...
Hmmmm ... looks like moodle docs need an update? Depending ...


'SoS', Ken

Dennis Fulton への返信

Re: Document Converter on Moodle 4.3

- Howard Miller の投稿
画像 Core developers 画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Peer reviewers 画像 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.
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?
Dennis Fulton への返信

Re: Document Converter on Moodle 4.3

- Ken Task の投稿
画像 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! 笑顔
'SoS', Ken