Display pdf protected file

Hello,
I want to display a protected pdf file.
It is in Retail/wp-content/plugins/s2member-files/access-s2member-level1 folder.
I used to use gview plugin but it does not work.
I read https://s2member.com/kb-article/how-do-i-display-protected-pdfs-with-the-pdf-viewer-plugin/ but it does not work also :

I downloaded pdf Viewer (it has not been updated for more than 3 years, is that a problem ?).
I change the file adress by adding “s2member-file-inline-no/”. The pdf viewer stay black.

Is there another way to display a protected file ?

Thanks a lot

Best regards

You don’t need to use a plugin. All modern browsers can display PDFs.

And don’t set inline to no. Inline is what you want!

Thank you for your quick answer.

Could you be more explicit ?

What kind of code shall I use ? Does it work with protect file ?

Sorry, I am not a technician, but a financial advisor ;).

Thanks

First, go to Download Options -> Inline File Extensions and check that pdf is in the list. If it is not, add it, scroll to the bottom, and click Save All Changes.

Then paste this shortcode into your content, changing name-of-your-file and Name of link as necessary:

<a href="[s2File download='name-of-your-file.pdf' /]">Name of link</a>
1 Like