简体   繁体   English

在特定程序(Adobe Reader)中打开下载的文件(PDF)

[英]Open downloaded file (PDF) in specific program (Adobe Reader)

I create PDF files on my server (Java servlet). 我在服务器(Java Servlet)上创建PDF文件。 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. 在(JSP)主屏幕中,有一个按钮,单击该按钮后,客户端应使用Adobe Reader打开PDF文件(从服务器下载)。

How to call exactly Adobe Reader to open that PDF file? 如何准确调用Adobe Reader打开该PDF文件?

If you have Adobe Reader as the default application to handle pdf files on the OS. 如果您将Adobe Reader作为默认应用程序来处理OS上的pdf文件。 Set the response HTTP header Content-Disposition this will force the browser to download the file instead of opening it within the browser. 设置响应HTTP标头Content-Disposition,这将强制浏览器下载文件,而不是在浏览器中打开文件。 This way opening the downloaded PDF will open on Adode Reader. 这样打开下载的PDF即可在Adode Reader中打开。

response.setContentType("application/pdf"); 
response.setHeader("Content-Disposition", "attachment; filename=downloaded.pdf");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Adobe Reader专门打开文件PDF? - How open file PDF exclusively with Adobe reader? Java在Adobe Reader中的客户端上打开pdf文件 - java open pdf file on client side in adobe reader 如何从Adobe Reader中的Android应用程序从服务器打开pdf - How to open pdf from server from Android app in Adobe Reader Adobe Acrobat Reader 无法打开 pdf 文件,因为它不是受支持的文件类型或文件已损坏 - Adobe Acrobat Reader could not open pdf file because it is either not a supported file type or because the file has been damaged 如何通过iText读取PDF文件并像在Adobe Reader中一样显示它? - How to read PDF file through iText and display it as in Adobe Reader? 从PDF Reader中的原始文件夹中打开pdf文件 - Open pdf file from raw folder in PDF Reader 尝试打开使用iText库创建的PDF时,Adobe Reader在Mac上显示错误 - Adobe reader shows error on mac when trying to open pdf which is created using iText library itext生成的pdf无法在Adobe Reader中打开? - Itext generated pdf not opening in Adobe reader? Adobe Reader 11.0.11中的PDF链接不起作用 - PDF Links in Adobe Reader 11.0.11 dont work 在Java应用程序中通过Adobe Acrobat打开PDF文件(通过OLE) - Open PDF File with Adobe Acrobat inside Java Application (via OLE)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM