res.contentType("application/pdf;base64");

why you need this? resp.content is a buffer not a base64 string so i think you are sending a bad header from the server, just use res.contentType("application/pdf")

for your client side part, i think you are better by using our browser client which contains some examples to show the pdf in new window. if for some reason you still want to handle the ajax request by yourself and not with our browser client then check the source code to better know how to handle the binary response