How to Display a PDF on Drupal

Written by hosam el-aker
  • Share
  • Tweet
  • Share
  • Email

Drupal is a feature-rich Web content management system with a deep, open-source code base. It is free to download and use, and you are free to remove from, add to and otherwise alter the code however you want. One of the features of Drupal is the ability to use a variety of different file types, including Portable Document Format (PDF) files. Though Drupal comes with the ability to display PDFs, the feature is not enabled by default. Displaying PDF files on your Drupal website requires the insertion of HTML code.

Skill level:


  1. 1

    Navigate to your Drupal website's admin control panel and log in. This is usually found at your domain name followed by "/admin," for example,>

  2. 2

    Click "Content" at the top of the screen. Click "Edit" across from the content in which you would like to display a PDF file, in the "Operations" column.

  3. 3

    Insert the following HTML code where you would like to display the PDF file:

    <object width="100%" height="500px" type="application/pdf" data="your_pdf_file_path" ></object>

    Edit "your_pdf_file_path" accordingly, as this refers to the path of the PDF file you would like to display. The ability for PDF files to be displayed depends in part on the user's browser configuration settings. If the visitor to whom you wish to show the PDF file does not have his browser configured accordingly or if you do not know if his browser is configured accordingly, add the following snippet of HTML code instead of the one above:

    <object width="100%" height="800px" type="application/pdf" data="your_pdf_file_path">

    <a href="path_to_pdf_file">Download PDF file</a></object>

    This code adds a link to the PDF file as well. Edit "your_pdf_file_path" to the path of the PDF file you wish to display. "Download PDF file" is the text that is displayed in the download link. You can make this say whatever you want.

  4. 4

    Click "Save" when you have finished entering the HTML code to display your PDF. Your PDF file will now be displayed the next time a visitor navigates to that content.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.