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

Embedded PDF files cause problems in some configurations

    Details

    • Testing Instructions:
      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.
    • Workaround:
      Hide

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

      Show
      Use the "Display: Open" setting for the file resource.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull Master Branch:

      Description

      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 .

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  60 Vote for this issue
                  Watchers:
                  55 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    11/Nov/13