Assignment Grading -Annotated PDF shows a blank page

Assignment Grading -Annotated PDF shows a blank page

by Dave Weninger -
Number of replies: 13

Dear Sir,

We are using the below system:

Moodle 3.6.1 (2018120301), CentOS 7,4.108, MySQL 5.7.21, PHP 7.2.16, Theme- Essential 3.6.01 (201812704),

It is reported that it shows a blank page at Annotated PDF when grading assignment. According to the below website, i think that unconv has not been installed. 

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

Therefore, it types the below command to install it.

git clone https://github.com/dagwieers/unoconv.git

cp unoconv/unoconv /usr/bin

However, it checked that Annotated PDF still shows a blank page. The unoconv is still not working. What steps I have missed? Please kindly advise. Thank you very much.

Best Regards,

Kelvin Ma



Average of ratings: -
In reply to Dave Weninger

Re: Assignment Grading -Annotated PDF shows a blank page

by Dave Weninger -
The blank page is shown when we grade a MS word file. The MSWord cannot be converted to PDF. We should have installed ghostscript properly. The system path of ghostscript has a green "tick", so it should have been configured properly.
In reply to Dave Weninger

Re: Assignment Grading -Annotated PDF shows a blank page

by Ken Task -
Picture of Particularly helpful Moodlers

unoconv is a python script and if you did put it in /usr/bin/ it would be accessible to this test by any user that has ssh login to server (ie, root).

As root user, type: unoconv -V and press ENTER.

Should see this:

unoconv 0.8.2
Written by Dag Wieers <dag@wieers.com>
Homepage at http://dag.wieers.com/home-made/unoconv/

platform posix/linux2
python 2.7.5 (default, Aug  7 2019, 00:51:29)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
LibreOffice 5.3.6.1

Unoconv uses LibreOffice converter in a headless mode.  It's LibreOffice that actually converts the docx you've mentioned to a pdf.

So is LibreOffice installed on server?  The app is really 'soffice' so what does your server say for this command:

soffice --version

That's 2 dashes before version.

Should reply with this:

[root@sos ~]# /usr/bin/soffice --version
LibreOffice 5.3.6.1 30(Build:1)

Is the listening service for unoconv listening?

Try this command to see:

[root@sos ~]# /bin/systemctl status unoconv.service

Should respond showing it's active and listening for request.

And lastly, ghostscript is involved ... is ghostscript installed?

whereis gs

use path you see in above command ouput to see version.

/usr/bin/gs --version

In the moodle config, are the paths to ghostscript/unoconv other CentOS cli utilities/programs set in Moodle?

To be honest ... using unoconv is more difficult to set up and the listener can be problematic.

Might be easiest to use the Google Document Conversions option.

'SoS', Ken





Average of ratings: Useful (1)
In reply to Ken Task

Re: Assignment Grading -Annotated PDF shows a blank page

by Dave Weninger -
[root@moodle ~]# unoconv -V
unoconv: Cannot find a suitable office installation on your system.
ERROR: Please locate your office installation and send your feedback to:
http://github.com/dagwieers/unoconv/issues

[root@moodle ~]# soffice --version
LibreOffice 5.0.6.2 00(Build:2)

[root@moodle ~]# whereis gs
gs: /usr/bin/gs /usr/share/man/man1/gs.1.gz

[root@moodle ~]# /usr/bin/gs --version
9.25

Q: In the moodle config, are the paths to ghostscript/unoconv other CentOS cli utilities/programs set in Moodle?
Ans: I don't the paths to ghostscript/unoconv. I only configure the path of ghostscript, not unoconv. I haven't set the paths to ghostscript/unoconv in any cli Moodle configuration file.

You mentioned "To be honest ... using unoconv is more difficult to set up and the listener can be problematic.
Ans: as my installation of unoconv is unsuccessful and the listenser can be problematic, I want to give up using unoconv. However, I have run the command "git clone https://github.com/dagwieers/unoconv.git", How can I undo this command? Is it of any harm?

You mentioned that "Might be easiest to use the Google Document Conversions option"
Ans: Can you share how to use this option? As our Moodle is being used heavily, I dare not to make great changes on Moodle. It is very dangerous if I crash the Moodle.

Thank you very much.
Best Regards,

Kelvin Ma
Attachment ghostscript path.jpg
In reply to Dave Weninger

Re: Assignment Grading -Annotated PDF shows a blank page

by Ken Task -
Picture of Particularly helpful Moodlers

You might need to update LibreOffice ...

Mine: /usr/bin/soffice --version

shows: LibreOffice 5.3.6.1 30(Build:1)

You didn't shared back this info:

/sbin/service unoconv status

Should show a green character then:
● unoconv.service - Unoconv listener for document conversions
Is it active?

If you have no service listening then it also won't work!

If you un-install unoconv (could do that simply by removing the python script in /usr/bin file is unovonv ... but IF you do then it's broken for sure! 

Only alternative would be Google conversions.   And you are 'worried' about that as well.   Soooo ... I can't make any calls for you.  You decide ... it's why you make the 'big bucks', right?

See: https://docs.moodle.org/38/en/Google_Drive_converter

and if you are gonna raise an issue of privacy using Google, then guess you'll have to find a way to make unoconv work!

My advice ... leave unoconv installed and upgrade LibreOffice.

Both unoconv and Google (once set up) can co-exist on server.   In Moodle admin interface, admin user chooses which the system is to use.  The other then is dormant for all practical purposes.   Never called by Moodle code at least!

Yes, unoconv listener has been problematic from time to time ... and needed restarting to properly function.

Use whatever works on your system and has the least need for troubleshooting ... hmmmm ... does anyone have a moodle server that *never* has issues from time to time? .... in a 'perfect' world!  Hmmmm ... is there such a thing! smile

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Assignment Grading -Annotated PDF shows a blank page

by Dave Weninger -
Dear Ken,

I have already upgrade the LibreOffice but the Annotated PDF still shows blank page. Sorry, I don't know how to start the service unoconv. unoconv.service is not active. I don't have service listening. Please advise.
And also, we have some teachers who teaches Chinese language. Should I download and install Chinese language pack for LibreOffice? Or, it has already included the language pack?

[root@moodle ~]# unoconv -V
unoconv 0.8.2
Written by Dag Wieers Homepage at http://dag.wieers.com/home-made/unoconv/

platform posix/linux
python 3.5.9 (default, Dec 6 2019, 12:17:35)
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)]
LibreOffice 6.3.4.2
[root@moodle ~]#

[root@moodle ~]# /sbin/service unoconv status
Redirecting to /bin/systemctl status unoconv.service
Unit unoconv.service could not be found.

[root@moodle ~]# bin/systemctl status unoconv.service
-bash: bin/systemctl: No such file or directory

[root@moodle ~]# soffice --version
-bash: soffice: command not found

[root@moodle ~]# find / -name soffice
/opt/libreoffice6.3/program/soffice

[root@moodle ~]# /opt/libreoffice6.3/program/soffice --version
LibreOffice 6.3.4.2 60da17e045e08f1793c57c00ba83cdfce946d0aa

[root@moodle ~]# whereis gs
gs: /usr/bin/gs /usr/share/man/man1/gs.1.gz

[root@moodle ~]# /usr/bin/gs --version
9.25

[root@moodle ~]# ps -ef |grep unoconv
root 16755 16126 0 23:00 pts/0 00:00:00 grep --color=auto unoconv
[root@moodle ~]# ps -ef |grep soffice
root 16761 16126 0 23:00 pts/0 00:00:00 grep --color=auto soffice

Thank you very much.
Best Regards,

Kelvin Ma
In reply to Dave Weninger

Re: Assignment Grading -Annotated PDF shows a blank page

by Ken Task -
Picture of Particularly helpful Moodlers

Please see:

https://docs.moodle.org/38/en/Universal_Office_Converter_(unoconv)#Run_a_unoconv_listener

and the links to directions for your platform on the page from the link above:

Upstart script for Ubuntu based systems
Launchd script for OS X
Init script for Debian
Init script for CentOS/RedHat 6.x
SystemD service script for CentOS/RedHat 7.x

'SoS', Ken

Average of ratings: Useful (1)
In reply to Dave Weninger

Re: Assignment Grading -Annotated PDF shows a blank page

by Ken Task -
Picture of Particularly helpful Moodlers

Not sure what language packs for default LibreOffice.  Do remember at one time in the past having to install other language packs ... but don't remember details.  Also remember, due to server space limitation, having to remove language packs to gain back some space (must have done a global kinda install and got too much!).

https://wiki.documentfoundation.org/Documentation/Install/Linux

Might help.

also ... DB server would have to be utf8mb4 with collation from utf8mb4 family to use/support Asian languages.

'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Assignment Grading -Annotated PDF shows a blank page

by Dave Weninger -
Thank you very much for your great support.

The Annotated PDF works well for English language now. However, it still cannot show Chinese characters. I have installed the traditional Chinese language pack from the below website.
https://download.documentfoundation.org/libreoffice/stable/6.3.4/rpm/x86_64/LibreOffice_6.3.4_Linux_x86-64_rpm_langpack_zh-TW.tar.gz.mirrorlist

download the language pack: LibreOffice_6.3.4_Linux_x86-64_rpm_langpack_zh-TW.tar.gz
WinSCP upload to /sources/libreoffice-6.3.4-languagepack
cd /sources
cd libreoffice-6.3.4-languagepack
cd LibreOffice_6.3.4.2_Linux_x86-64_rpm_langpack_zh-TW
cd RPMS
yum localinstall *.rpm


[root@moodle ~]# rpm -qa|grep libreoffice
libreoffice6.3-freedesktop-menus-6.3.4-2.noarch
libreoffice6.3-base-6.3.4.2-2.x86_64
libreoffice6.3-dict-en-6.3.4.2-2.x86_64
libreoffice6.3-dict-fr-6.3.4.2-2.x86_64
libreoffice6.3-6.3.4.2-2.x86_64
libreoffice6.3-math-6.3.4.2-2.x86_64
libreoffice6.3-impress-6.3.4.2-2.x86_64
libreoffice6.3-zh-TW-6.3.4.2-2.x86_64
libreoffice6.3-draw-6.3.4.2-2.x86_64
libreoffice6.3-calc-6.3.4.2-2.x86_64
libreoffice6.3-en-US-6.3.4.2-2.x86_64
libreoffice6.3-ure-6.3.4.2-2.x86_64
libreoffice6.3-writer-6.3.4.2-2.x86_64
libreoffice6.3-dict-es-6.3.4.2-2.x86_64
libobasis6.3-libreofficekit-data-6.3.4.2-2.x86_64

Also, I checked that our mysql supports utf8mb4_unicode_ci . What steps had I missed?

Please kindly advise if you know. Thank you very much.
Best Regards,
Kelvin Ma
In reply to Dave Weninger

Re: Assignment Grading -Annotated PDF shows a blank page

by Ken Task -
Picture of Particularly helpful Moodlers

After re-reading, me thinks you have misunderstood the capabilities of Annotation/unoconv/LIbreoffice and how Moodle works.

If a word doc (or document type moodle unoconv could convert to PDF) is in English, the resulting PDF is in English.

For a teacher to see a PDF in zh_tw the student would have to submit the doc in zh_tw.

In other words, what you are working on doesn't translate contents of  documents from any language to desired language.

'SoS', Ken



In reply to Ken Task

Re: Assignment Grading -Annotated PDF shows a blank page

by Dave Weninger -

I haven't misunderstood. The teacher who teaches Chinese language subject asks for an assignment written in Chinese (zh_tw). The student certainly submits his assignment written in Chinese (zh_tw). I also tested by submitting a dummy assignment written in Chinese (zh_tw), but it shows  square symbol instead of Chinese characters (e.g. 大學)

Kelvin Ma



In reply to Dave Weninger

Re: Assignment Grading -Annotated PDF shows a blank page

by Ken Task -
Picture of Particularly helpful Moodlers

What's the language of the course?

And confirm (for yourself - am not requesting response here as we've done this before, right?):

1. you do have the Moodle zh_tw language pack installed in the moodle.

2. a command line test of unoconv converts a .docx to a .pdf.  And that the PDF is readable.

3. in config.php file the variable for DB collations is set to utf8mb4 family

4. that the DB, tables, and all columns in the tables match the collation seen in config.php (cli scripts in admin/cli/)

That's about all I have to suggest!

'SoS', Ken


In reply to Dave Weninger

Re: Assignment Grading -Annotated PDF shows a blank page

by Victor Chebech -

I often use any formats of video files and I need to find a good converter. What do you know about this converter and what else recommend to me?  onlineconvertfree.com I need to solve this problem right now.