Discourse send PDF inline

:information_source: Summary Show local served PDFs in the browser
:hammer_and_wrench: Repository Link GitHub - thoka/discourse-send-pdf-inline: Patch discourse do serve PDFs inline
:open_book: Install Guide How to install plugins in Discourse

Features

Uploaded PDFs are opened with “content disposition inline”, which allows them to be displayed in the browser instead of being offered for download.

Configuration

Not necessary.

5 Likes

How is this different / better than the existing Theme Component to do the same?

1 Like

The plugin directly opens the PDF in the browser, not in an embedded element inside a post :slight_smile:

This was a feature request: Add configuration option to serve local PDF uploads inline

2 Likes

Does local mean S3 and similar plus CDN will fail when using this plugin?

It does not alter the way, S3 serves PDFs.
Side effects would be magic.

4 Likes

Is this plugin still in a working condition?

We are still using it.

2 Likes

Unfortunately, it’s broken currently.
I have to investigate.

2 Likes

Maybe I’m naive, but I think most people would want PDFs to render in the browser by default.

@thoka, is there any reason you opted to publish a plugin for this functionality rather than trying to upstream it into Discourse?

I found time to test it.
The plugin is working as expected.
I do not understand, what might have caused problems in the meantime.

I wrote the plugin, since there were no responses to my feature request.

When thinking about drawbacks of sending PDFs to the browser directly, I envision the following potential issues:

When utilizing Discourse as a Progressive Web App on a mobile device, one inevitably exits the Discourse interface, or rather its user interface, to display the PDF, thereby relying on the user’s familiarity with navigating back to the original application.

Furthermore, when it comes to mobile devices, one is at the mercy of how the browser handles inline PDFs. While Firefox currently displays the file directly, it appears that there is no way to persuade Chrome to do so:

1 Like