开发者

Get HTML content by HttpServletResponse / HttpServletRequest

开发者 https://www.devze.com 2023-04-11 08:46 出处:网络
Is there any way to obtain a HTML content by开发者_运维知识库 HttpServletResponse or HttpServletRequest?

Is there any way to obtain a HTML content by开发者_运维知识库 HttpServletResponse or HttpServletRequest?

I need to print a PDF based on HTML object.


In this scenerio i would use a filter. You can access content which wanted to be output and redirect the output stream to your PDF generator which can convert HTML to PDF.

More about Filters : http://www.oracle.com/technetwork/java/filters-137243.html

common way is to create PDFs from model objects. Then use iText. http://itextpdf.com/


You can create a PDF from the HTTP request data and whatever other information you need from the server side by merging it into a Velocity template containing the FO defining your PDF.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号