Viewing PDF is incomplete in Chrome Browser

Viewing PDF is incomplete in Chrome Browser

by JC Dodo -
Number of replies: 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

Average of ratings: -
In reply to JC Dodo

Re: Viewing PDF is incomplete in Chrome Browser

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Did you try a different PDF? Maybe your PDF is defective.
In reply to Michael Milette

Re: Viewing PDF is incomplete in Chrome Browser

by 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.
In reply to JC Dodo

Re: Viewing PDF is incomplete in Chrome Browser

by 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
Average of ratings: Useful (3)
In reply to Michael Milette

Re: Viewing PDF is incomplete in Chrome Browser

by JC Dodo -
Also, I tried to turn off CDN and WAF. Still similar issue...