How to create “page” used for generating PDF? [closed]

Since it’s a standalone script, you can just link to it directly and WordPress will be none the wiser. Just make sure you get the link right – if it’s in your theme, it will be something like:

http://example.com/wp-content/themes/my-theme/generate-pdf.php

Don’t hardcode the URL though, use the available template functions:

<a href="https://wordpress.stackexchange.com/questions/199196/<?php bloginfo("template_url' ) ?>/generate-pdf.php">Generate!</a>

Of course if you want a “pretty” URL you can use the rewrite API.