-
AuthorPosts
-
June 18, 2021 at 6:25 pm #1306447
Hello,
A site of mine has some links which direct to PDF content on the site. Previously, these links have just opened a new browser tab and displayed the PDF. This still works on desktop / tablet, but on mobile, specifically Chrome on Android, it’s now trying to download the PDFs, rather than simply display them as before.
As it doesn’t make it clear that it’s downloading them, this is creating a poor user journey, and users are failing to see the content.
Is there a way to force the mobile browser to display the PDF in the browser as before, rather than download it? Anyone got any idea why this has changed?
Link to an example in private content.
Thanks!
June 20, 2021 at 9:01 pm #1306583Hey maccadigital,
Thank you for your patience and the link to your page, I have tested your pdf in two chromium-based browsers Chrome & Brave, in Chrome the pdf is downloaded in the background and in Brave it is opened in a new tab. This is due to how the browser developers are handling the request, and this shows that Chrome has specifically made this change to the chromium base code.
To correct this you could add this code to your .htaccess file on your web server<FilesMatch "\.(pdf)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch>
I believe this will work because it will specifically tell the browser what to do instead of letting the browser decide, but please note that if you search Google for
force Chrome to open pdf
almost all of the results explain how to change your browser settings, making it look like each user will need to manually select this option, which may be the direction Chrome is going.
In the future, you may wish to add a highlighted tip below your buttons directing your visitors to more info on downloading your pdf’s.Best regards,
MikeJune 21, 2021 at 10:27 pm #1306827Thanks, Mike. I’ll give that a go. Appreciate your help.
June 22, 2021 at 1:31 pm #1306935Hi,
After testing please let us know if this helped, hopefully, this will also help direct future users with this issue.Best regards,
MikeJune 29, 2021 at 11:19 am #1307904Hi Mike,
In testing, this actually seems to make things worse. The PDF links are now not displaying OR downloading. The screen flashes as if something is happening, but then nothing does. This is both on mobile and desktop.
Do you have any other suggestions?
thanks!
July 1, 2021 at 12:22 pm #1308305Hi,
Sorry for the late reply and thanks for your patience, I tried researching this some more but I didn’t find any new information that would help, I asked the rest of our team for further ideas.
Perhaps it would help to have a highlighted tip box below your buttons, such as “Not Seeing the PDFs?” that will link to an explanation, with a little css this can be made to show only on mobile devices.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.