Viewing PDF is incomplete in Chrome Browser

Viewing PDF is incomplete in Chrome Browser

de JC Dodo -
Número de respuestas: 5

Hi,

This is strange behavior of viewing PDF file from the Chrome browser as it shown below. 

This only happen in google chrome. The Moodle version is 3.4 and 3.8.4+. 

There were no error messages as well in web server logs or php logs when turning debug mode in config.php. 

Appreciate if anyone could shed some lights?

viewing pdf on browser

Thanks! -J

Promedio de valoraciones: -
En respuesta a JC Dodo

Re: Viewing PDF is incomplete in Chrome Browser

de Michael Milette -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Plugin developers Foto de Testers Foto de Translators
Did you try a different PDF? Maybe your PDF is defective.
En respuesta a Michael Milette

Re: Viewing PDF is incomplete in Chrome Browser

de JC Dodo -
I tried to view all PDF and they are all fine. But with this particular PDF, I don't know. When I tried to download that PDF, I can open it in chrome browser. The only issue is when viewing that PDF from Moodle.

I cannot find any error logs from webserver and php. I am running options in here.

I would appreciate if anyone could share me some lights.
En respuesta a JC Dodo

Re: Viewing PDF is incomplete in Chrome Browser

de Artur Welp -
I crossed on this problem this month.

This is a Chromium specific bug and is reported since the beginning of the year.
https://support.google.com/chrome/thread/66790726?hl=en
https://bugs.chromium.org/p/chromium/issues/detail?id=1123389&q=fast%20web%20view&can=2

The problem is due the Web Optimization options on the software exporting the PDF.
If you want to render it on Chrome, disable this option. This thread also covers the problem
https://moodle.org/mod/forum/discuss.php?d=408359#p1649501

I did't have the PDF source, so I followed this process:

Split the PDF on many PNGs with https://pdf2png.com/
Merge the PNGs with https://pdf2png.com/
If there were too many images. I used Imagemagic to merge all PNGs on a folder with this command:

 convert *.png merged.pdf