PDF download – use wordpress functions

You should create a function in your plugin where you listen to a specific URL or watch for specific parameters. For example to generate the download link:

<?php
    $nonce = wp_create_nonce( 'download-' . $filename );
    echo '<a href="https://wordpress.stackexchange.com/?_wp_nonce="' . $nonce . '&download=' . $filename . '">Some Download</a>';
?>

And to download the file:

if ( ! empty( $_GET['_wp_nonce'] ) && ! empty( $_GET['download'] ) && wp_verify_nonce( $_GET['_wp_nonce'], 'download-' . $_GET['download'] ) ) {
    /*
     * Check if file exists and then output the right headers and the content of the file
     */

    exit;
}