Unable to keep PDFs from being indexed

I'm usually one to search and search until I eventually find my answer, and have rarely asked the internet for help, but I'm stuck on this one and I've exhausted all the resources I have trying to come up with an answer.

I currently have a number of PDFs which are being used as free ebooks on my Wordpress site. I do not want any of them indexed by Google, however every method I've tried, does not seem to work.

So far I have tried editing the .htaccess with the following:

    <FilesMatch “.pdf$”>
    Header set X-Robots-Tag “noindex, noarchive, nosnippet”
    </FilesMatch>

I have also tried:

    <Files ~ "\.pdf$">
    Header set X-Robots-Tag “noindex, noarchive, nosnippet”
    </Files>

Both of those cause 500 errors when added to my .htaccess file. I know that the .htaccess file works, as there are 301 redirects in there that are affected when I edit them.

I have also gone into Yoast SEO and changed the settings for one of the PDFs in question to:

Allow search engines to show this Media in search results? - No
Should search engines follow links on this Media? - No
Meta robots advanced:  No Image Index / No Archive / No Snippet

I have not seen any impact on the response headers for any of the PDFs on my site. I have tested the header responses using the Web Developer http://chrispederick.com/work/web-developer/chrome/ and there are no changes.

As far as I can tell there are no settings on the server that could be causing a conflict, though that feels like its likely in this scenario.

It also appears that using the robots.txt is not best practice anymore, as Google will be ignoring those in the near future.

Can anyone point me in the right direction?