jsp 页面
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!doctype html>
<html>
<head>
<%@ include file="/WEB-INF/pages/globalweb/head/pagehead_v5.ini"%>
</head>
<body>
<iframe src="" marginwidth="0" target="_self" id="faFrame"
marginheight="0" frameborder="0" width="100%" height="945px"
style="overflow-x: hidden; overflow-y: auto;">
</iframe>
</body>
<script type="text/javascript">
$("#faFrame").attr("src",$.getURL(_path + "/fagl/faxxck_dyxx.html?
id=${faxx_id}"+'&dlbs='+$("#dlbs").val()));
</script>
</html>
Action 调用
public String dyxx(){
ByteArrayOutputStream bous = null;
try{
StringBuffer title = new StringBuffer("");
title.append(faxxckModel.getfamc());
//开始生成pdf
bous = service.createPdf(title,faxxckModel);
this.fileName = new String((title.toString() + ".pdf").getBytes(), "ISO8859-1");
this.inputStream = new ByteArrayInputStream(bous.toByteArray());
return Result.PDF_INLINE;
} catch (Exception e) {
logException(e);
return ERROR;
}finally{
IOUtils.closeQuietly(bous);
}
}
接口不写了
直接 实现类
@Override
public ByteArrayOutputStream createPdf(Pyfaxx