These days, session IDs are mostly passed in cookies, but occasionally you'll have someone who refuses cookies, so a truly robust webapp will also support URL rewriting.
However, the cookie is attached to the
browser, so unless your system is set up to launch a different web browser when you click in a PDF, I don't think it should be losing the session on that account.
A more serious problem is that PDF's have an indefinite lifespan, but sessions are normally quite limited. So if I print a PDF today and click on the link tomorrow, that's simply not going to work. The session will almost certainly have been destroyed.
Which is just as well, since if the application is a secure one, you'd have a
major security issue if someone could just click and go right in.
Rather that attempting to put a session ID in the PDF,
you should look at putting some sort of information that can be used to reconstruct whatever session context you need when the link/button is clicked.