Reputation: 83
I create PDF files on my server (Java servlet). In the (JSP) home screen, there's a button that when clicked should have the client open the PDF file (downloaded from server) with Adobe Reader.
How to call exactly Adobe Reader to open that PDF file?
Upvotes: 0
Views: 1401
Reputation: 523
If you have Adobe Reader as the default application to handle pdf files on the OS. Set the response HTTP header Content-Disposition this will force the browser to download the file instead of opening it within the browser. This way opening the downloaded PDF will open on Adode Reader.
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "attachment; filename=downloaded.pdf");
Upvotes: 1