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

Embedded PDF files cause problems in some configurations

XMLWordPrintable

    • MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • Hide

      Use the "Display: Open" setting for the file resource.

      Show
      Use the "Display: Open" setting for the file resource.
    • Hide

      Note: This test run needs to be done using a browser that supports embedding PDF files, such as Firefox 21.

      • Enter a course when logged in as teacher.
      • Upload a file by drag & drop.
      • Click on the filename (to open the file).
      • Verify: PDF file is opened in a separate window/tab/viewer (not embedded in the Moodle page).
      • Return to the course page (with editing on).
      • Click on "Update" from the pop-up menu next to the file resource.
      • Set "Appearance -> Display" to "Embed", then click "Save and return to course".
      • Click on the filename again.
      • Verify: PDF file is opened in an embedded PDF viewer.
      Show
      Note: This test run needs to be done using a browser that supports embedding PDF files, such as Firefox 21. Enter a course when logged in as teacher. Upload a file by drag & drop. Click on the filename (to open the file). Verify: PDF file is opened in a separate window/tab/viewer (not embedded in the Moodle page). Return to the course page (with editing on). Click on "Update" from the pop-up menu next to the file resource. Set "Appearance -> Display" to "Embed", then click "Save and return to course". Click on the filename again. Verify: PDF file is opened in an embedded PDF viewer.

      In Moodle 2.x, the default setting for the "File" resource is "Display: Automatic". For PDF files, this means that they will be shown as an embedded PDF viewer (if a browser plugin is available). This causes problems in various configurations:

      • In IE 8 (other versions not tested), the PDF file is displayed but not in a very user-friendly way: The "viewport" for the PDF file is rather small, covers only part of the screen, and is in landscape format (whereas typical PDF documents are portrait format, at least for us). There is no obvious option to open the document in a larger window.
      • Users of mobile devices (Android, iPad) have reported that the files are displayed, but they are unable to scroll to the next page. (Likely this is a problem with mobile browsers, but one that seems to be widespread.)

      All in all, I don't see much benefit for displaying PDFs in an embedded window, however I see that it causes problems to some of our users.

      Suggestions for a solution:
      (a) Remove PDF from the list of file types to be displayed in an embedded frame - see mod/resource/locallib.php, function resource_get_final_display_type(), variable $embed

      (b) Alternatively, display a link to the file above the embedded frame.

      I can provide a patch, but would be happy about some feedback regarding the options above.

      See also http://moodle.org/mod/forum/discuss.php?d=164712 .

            bostelm Henning Bostelmann
            bostelm Henning Bostelmann
            Dan Poltawski Dan Poltawski
            Sam Hemelryk Sam Hemelryk
            Jason Fowler Jason Fowler
            Votes:
            60 Vote for this issue
            Watchers:
            54 Start watching this issue

              Created:
              Updated:
              Resolved:

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