How to Display a PDF on Drupal

104 38
    • 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, http://website.com/admin.

    • 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). Insert the following HTML code where you would like to display the PDF file:

      <object 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 type="application/pdf" data="your_pdf_file_path"><br /><br /><a href="/links/?u=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). 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.

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.