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:
Other People Are Reading
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, http://website.com/admin.>
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.
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.
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.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for