bozoh / moodle-mod_simplecertificate

It's NOT RECOMMENDED to install version below 2.2.6 (MOODLE_31), due a security issues See more in README
17 stars 44 forks source link

'Insufficient data for an image' error when opening certificate PDF in Adobe Acrobat Reader #233

Closed valeriia-s closed 4 years ago

valeriia-s commented 4 years ago

Describe the bug When opening certificate PDF in the latest version of Adobe Acrobat Reader I see 'Insufficient data for an image' error, the PDF is blank.

Moodle Version Moodle version is 3.8.1.

Plugin Version Plugin version is 2.2.8 (2018082000).

To Reproduce Steps to reproduce the behavior:

  1. Go to the simple certificate page
  2. Click on 'Get certificate'
  3. Download the certificate PDF to your PC
  4. Open the certificate PDF in Adobe Acrobat Reader
  5. See error 'Insufficient data for an image'
  6. Click 'Ok'
  7. Certificate PDF is blank

Expected behavior The PDF file is opened in Adobe Acrobat Reader without any errors, it's not blank.

Screenshots Screenshot of the error:

2020-02-14_1009

Desktop:

Other details: We discovered that often this error message has to do with the PDF structure, which can be caused by the application that produced the PDF (Simple Certificate seems to use an open source program called TCPDF). I found this thread that discussed potential issues and was curious if the fix could have to do with the icc profile. This goes above my head, but another user said that adding code to remove icc profile fixed what sounds like a similar issue to ours: https://stackoverflow.com/questions/24954806/insufficient-data-for-an-image-message-when-opening-pdf

valeriia-s commented 4 years ago

We had a .jpg image as a Certificate Image File. When we change it to .png it resolves the issue.