Whenever I upload a PDF, it shows in the topic as follows:
I’m using Inline PDF to display it in Desktop version. But, in mobile Inline PDF won’t work. Further, Google or other search engines autodetect the PDF files, but whenever the user clicks on those results, the PDF download dialogue will appear instead of opening in a tab. This is a bit unfriendly and most of the users prefer to view the PDF online instead of downloading it at a place and opening.
Is there any solution to this?
NOTE: I’ve seen this topic PDF preview instead of download, on uploaded files, but the topic ended without any relation to the original question. Hence, this new topic.
Thanks for raising this question. I’m also curious to know the answer!
Embed a PDF Stored on Google Drive
PDFs display in Mobile as well as Desktop.
(My preferred method so PDFs in iFrames display in any device as responsive)
- Copy Share Link
- Open Share Link in a New Tab
- Click the 3 Vertical Dots in the Top Right Corner
- Select Embed Item
- Copy the Displayed iFrame Code
- Paste it in the Discourse Composer / Editor
Inline PDF does not work for me on desktop either.
I’m partially successful displaying PDFs inline when adding them to
But then a parameter “inline=1” is needed:
This could be added in some theme-component (Inline PDF Previews).
I would like to learn a clean way to switch discourse to serve PDFs with
content-disposition: inline using a plugin or a configuration option.
I managed to write a small plugin for this purpose: