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

رداً على Ken Task

Re: Document Converter on Moodle 4.3

بواسطة - Dennis Fulton
Where is the admin path settings?
رداً على 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