How to use the PDF module

Created on 25 January 2021, almost 4 years ago
Updated 5 June 2024, 6 months ago

Problem/Motivation

I would like to use the PDF module to show a PDF file that I can upload or is already in the server.
But it might sound silly to many, but I have no clue on how to use it.
It could be very helpful to add explanation to the module Drupal page. I can manage that, once I understand how to use.

Steps to reproduce

I installed the module and the library.

πŸ’¬ Support request
Status

Active

Version

1.0

Component

Documentation

Created by

πŸ‡«πŸ‡·France andrimont

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States pftech

    ... I have the module installed, the library in place, the type created, and the display set to PDF... Now what? I selected the PDF as a content type instead of a "Basic Page" or "Article" etc., but the preview/front end of the site does not display the PDF.

    What else is required to see the PDF?

    Clear and detailed instructions would be helpful for anyone who is encountering this plugin for the first time.

  • πŸ‡ΊπŸ‡ΈUnited States pftech

    I have created a PDF detailing how to install and initiate this plugin. Please see the zip file of the PDF.

  • πŸ‡ΊπŸ‡ΈUnited States pftech

    I updated the document with new information on troubleshooting and fixing the blank viewer issue.

  • πŸ‡ΊπŸ‡ΈUnited States pftech

    I updated the document with new information on troubleshooting and fixing the blank viewer issue.

  • πŸ‡«πŸ‡·France Toki Caen, Normandy

    @pftech, thank you for time on this tutorial.

    Unfortunately, I still get the blank viewer with this message twice, on pdf.mjs and viewer.mjs :

    Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.

    May I ask which version of pdf.js you have used? in my example, I tried with the latest, 4.0.379.
    The .htaccess you mentioned is the one in sites/default/files?
    Could you be more precise on the 3b step : add AddType application/javascript? Maybe share your .htaccess file?
    Have you set something special for the custom path to viewer.html (at admin/config/media/pdfjs)?

    Thanks for any tip here.

  • πŸ‡«πŸ‡·France Toki Caen, Normandy

    I tried several times to get the PDF module to work...
    Now I am using PDF Reader β†’ on Drupal 10 and everything goes well out of the box.

Production build 0.71.5 2024