简体   繁体   English

将JSP页面打开为PDF文件

[英]Open JSP page as PDF file

In reporting section of my application report is generated and contents are shown on jsp page, as part of requirement user wants to download report in form of both excel and pdf. 在我的应用程序的报告部分中,生成报告并将内容显示在jsp页面上,作为要求的一部分,用户希望以excel和pdf的形式下载报告。

I got this thing work for excel by changing contenttype of jsp page as below 我通过更改jsp页面的内容类型来使此东西适用于excel,如下所示

contentType="application/vnd.ms-excel"

However same thing for pdf is not working 但是同样的东西对于PDF不起作用

这会起作用

response.setContentType("application/pdf");

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM