The request header indicates what you're sending to your server. That
should stay as application/x-www-form-urlencoded.
I won't say it's not possible to retrieve the PDF via AJAX, but you're
asking for more work trying to find a way to present it via
JavaScript. You could maybe even do what you want without even using
AJAX. However, sticking to what you asked one method would be to have
the server create the PDF and save it in a web-accessible location.
What the server would then return would be the location of the PDF,
which your client-side script would use to, for example, generate an
iframe that uses the returned PDF location for the src attribute.
That's one way to handle this.