Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-82440

Ghostscript 10.03.1 and above breaks assignment feedback preview

XMLWordPrintable

      When testing on a higher version of Ghostscript (10.03.1), we discovered that the assignment preview and grading in Moodle is broken and renders a white blank screen instead of the expected document.

      Diving a bit deeper, we discovered that ghostscript by default, processes the file with default PDF compatibility set to 1.7, which the free parser shipped with FPDI does not support.

      The error message generated is as follows:

       

      Exception - This PDF document probably uses a compression technique which is not supported by the free parser shipped with FPDI. (See https://www.setasign.com/fpdi-pdf-parser for more details) Debug:
      Error code: generalexceptionmessage
      * line 257 of /mod/assign/feedback/editpdf/fpdi/PdfParser/CrossReference/CrossReference.php: setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException thrown
      * line 209 of /mod/assign/feedback/editpdf/fpdi/PdfParser/CrossReference/CrossReference.php: call to setasign\Fpdi\PdfParser\CrossReference\CrossReference->initReaderInstance()
      * line 67 of /mod/assign/feedback/editpdf/fpdi/PdfParser/CrossReference/CrossReference.php: call to setasign\Fpdi\PdfParser\CrossReference\CrossReference->readXref()
      * line 157 of /mod/assign/feedback/editpdf/fpdi/PdfParser/PdfParser.php: call to setasign\Fpdi\PdfParser\CrossReference\CrossReference->__construct()
      * line 205 of /mod/assign/feedback/editpdf/fpdi/PdfParser/PdfParser.php  

      We also discovered that if we were to force the ghostscript compatibility to something like 1.4, it would create a file compatible for the other library to read (e.g. using the flag -dCompatibilityLevel=1.4)

      Whilst this flag can be used for now, it is not a long term solution.

       

            frederikmillingpytlick Frederik Milling Pytlick
            kevinpham Kevin Pham
            Gilles-Philippe Leblanc Gilles-Philippe Leblanc
            Glyn (Mathew) May Glyn (Mathew) May
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            8 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 20 minutes
                5h 20m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.