After version 0.21.5

When I update to a newer version, I go to every article individual my PDF viewer force to download the document instead of display the web viewer. I have to rollback to 0.21.5. Any suggestions?

Hi @WR276, welcome to our community and sorry for the late answer! We have some explanation for that.

Before version 0.21.5, Tainacan always rendered PDF files in-browser using a third party JavaScript library: PDF.js - Home

Sadly, a couple months ago we got our plugin blocked in the WordPress repository due to a security breach that was originated in this library scripts. The security issue itself was fixed in more recent versions of the library, but in those versions they changed their build process, with changes that made impossible for us to adjust the mechanism used for finding PDF files that were attached to private items.

After a long debate around, we agreed to remove that library and leave the PDF rendering under the responsability of the Browser itself. Years ago, when we started Tainacan, this was really hard but today, most modern browsers do provide their built-in PDF readers. The greater exception to that are Mobile Browsers, because they favor dowloading the file for obtaining a better experience with native mobile PDF readers.

So if you’re trying to visualize PDF files in a desktop browser, possibly updating it will be enough (unless we’re talking Internet Explorer, in this case there would be even larger issues from us and other WordPress-related stuff).

If you’re trying to open PDF files in a smartphone, that is just the way most browsers prefer the experience, and we’re kinda dealing with that as a balanced way to keep things working and safe. Keep in mind that even with a build–in PDF library, you are downloading the file before visualizing it, things are just going to another folder in your system.

Hope this clarifies things :slight_smile:

Understood. However we use Tainacan for 4 investigation magazines already online. The need to show the PDF articles embeded in the rendered page itself. Do you have any hint on how can I achieve it?

Our magazines use Blocksy as default theme.

Uhm… I can see if I create a plugin that brings back that functionality but then we would not send it to the WordPress directory plugin due to its lack of security :thinking:

After a bit of discussion here around this, we agreed to create a plugin that brings back this functionality. Just keep in mind that it will bring back the security flaw:

https://github.com/tainacan/tainacan-unsecure-legacy-pdfjs/releases/download/v1.0.0/tainacan-unsecure-legacy-pdfjs.zip

After another update from your end on Wordpress directory, this will be unusable?

Sure, this is not a replacement of the Tainacan plugin, it is a complementary plugin. It just adds this extra functionality. You will keep receiving updates from the core plugin via the WordPress directory.

It seems that doesnt work correctly. It shows the PDF viewer but doesn’t shows the document itself. I have to rollback to 0.21.5 anyways. If you have any update on this subject, pleas elet me know.

This is likely some other configuration that we would need to adjust on it, can you give more details?

I would advice strongly against keeping an outdated version. We’re doing an effort here to offer the feature externally via plugin because using an old version will keep you out of bug fixes, security updates and will likely cause compatibility issues with WordPress and themes in the feature. Let’s see what is the cause of your issue first.

Este tópico foi fechado automaticamente 60 dias depois da última resposta. Novas respostas não são mais permitidas.