Users are seeking a way to force PDFs to open/view directly in the browser instead of downloading, especially on mobile where Inline PDF doesn’t work. avndp notes that search engines trigger downloads, which is unfriendly for users who prefer online viewing. jord8on agrees the issue is important. denvergeeks suggests embedding PDFs via Google Drive using iFrames — a responsive solution that works on both desktop and mobile. thoka reports Inline PDF doesn’t work on desktop either and explains a workaround involving modifying FileHelper.inline_images and adding inline=1 to URLs, potentially via a theme component. thoka later shares a custom plugin they built to solve this: discourse-send-pdf-inline, which forces PDFs to serve with content-disposition: inline. The discussion highlights a gap in Discourse’s default behavior and offers both a quick embed workaround and a technical plugin-based fix.
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.