Skip to content
Eren Gaygusuz
Go back

Embedding OneDrive PDF Files in Moodle

A PDF stored in OneDrive can be displayed directly inside a Moodle Page resource. This archived walkthrough uses the 2016 OneDrive and Moodle interfaces; current menu labels may differ.

Before publishing, check the file’s sharing permission with a learner account. An embed only works when the viewer is allowed to open the original file.

OneDrive PDF, embed code, and Moodle page workflow

Table of contents

Open Table of contents

Creating a Moodle Page

In the course, choose Add an activity or resource, select the Page resource, and click Add. Give the page a name, then switch its content editor to HTML mode.

Selecting Moodle Page resource Naming the Moodle page and opening HTML mode

Uploading the PDF to OneDrive

In OneDrive, choose Upload > Files, select the PDF, and open it when the upload has finished.

Opening OneDrive upload menu Selecting PDF file to upload Opening uploaded PDF in OneDrive

Generating and Adding the Embed Code

Choose OneDrive’s Embed option, create the code, copy it, and paste it into Moodle’s HTML editor.

Opening OneDrive PDF embed option Creating OneDrive PDF embed code Copying OneDrive PDF embed code Pasting PDF embed code into Moodle

Save and display the resource once to check how the viewer fits in the page.

Initial Moodle page with PDF viewer

Adjusting Viewer Dimensions

If the first display is too small, return to HTML mode and edit the width and height attributes in the copied embed markup. The source example uses width="1000" and height="1210".

<iframe src="..." width="1000" height="1210"></iframe>
Editing PDF embed width and height in Moodle HTML mode Saving revised PDF embed dimensions PDF embedded at improved dimensions in Moodle

Summary

OneDrive’s embed code lets Moodle show a PDF without a second upload. Keep the source file accessible, set dimensions suitable for the course layout, and test the page as a learner.


Share this post:

Comments


Previous Post
Embedding OneDrive Office Files in Moodle
Next Post
Embedding OneDrive Videos in Moodle