Force download pdf on IOS

For download an upload pdf on ios i should use after the link:

?wtn-download-file=true

I made a javascript to do it dinamically and change all my upload links as follow:

<script> $('a.attachment[href$=".pdf"]').attr('href', function( i, val){ return val + "?wtn-download-file=true"; }); </script>

I set it on my head theme but didnt work