绿联转换器如何使用用iText的HTML转换为PDF

If Not IO.File.Exists(inputfile) Then
Throw New IO.FileNotFoundException("输入文件 " & inputfile & " 不存在。")
Dim r As New IO.StreamReader(inputfile)
Dim st As New iTextSharp.text.html.simpleparser.StyleSheet
st.LoadTagStyle("body", "leading", "16,0")
Dim doc As New iTextSharp.text.Document
iTextSharp.text.pdf.PdfWriter.GetInstance(doc, New IO.FileStream(outputfile, IO.FileMode.Create))
doc.Open()
Dim ary As ArrayList = iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(r, st)
'Console.WriteLine(ary.Count)
For i As Int32 = 0 To ary.Count - 1
doc.Add(CType(ary(i), iTextSharp.text.IElement))
Console.WriteLine(i)
doc.Close()
Catch ex As Exception
Throw New System.Exception("HTML 转 PDF
发生错误。" & ex.Message, ex)itextpdf之html转PDF_itext html转pdf_词汇网
itextpdf之html转PDF
责任编辑:词汇网 发表时间: 1:19:09
用到生成PDF,搜了一通发现很对人都是通过修改源码实现中文支持,在这里提供一个不需要修改源码即可支持中文的工具类。思考:用到第三方工具是可以找到源码看看,源码中往往会给出丰富的例子。 标签:
代码片段(1)[全屏查看所有代码] 1.[代码][Java]代码 import java.io.*;import java.nio.charset.Cimport mons.lang.StringUimport org.jsoup.Jimport org.jsoup.nodes.Eimport com.itextpdf.text.Dimport com.itextpdf.text.Fimport com.itextpdf.text.pdf.BaseFimport com.itextpdf.text.pdf.PdfWimport com.itextpdf.tool.xml.Pimport com.itextpdf.tool.xml.XMLWimport com.itextpdf.tool.xml.XMLWorkerFontPimport com.itextpdf.tool.xml.XMLWorkerHimport com.itextpdf.tool.xml.css.CssFilesIimport com.itextpdf.tool.xml.css.StyleAttrCSSRimport com.itextpdf.tool.xml.html.CssAppliersIimport com.itextpdf.tool.xml.html.Timport com.itextpdf.tool.xml.parser.XMLPimport com.itextpdf.tool.xml.pipeline.css.CssResolverPimport com.itextpdf.tool.xml.pipeline.end.PdfWriterPimport com.itextpdf.tool.xml.pipeline.html.AbstractImagePimport com.itextpdf.tool.xml.pipeline.html.HtmlPimport com.itextpdf.tool.xml.pipeline.html.HtmlPipelineC/** * Html 转PDF工具类 *
* 支持简单的html格式,对css解析不够好 * * @author bangis.wangdf * @date 16/6/22.20:15 */public class Html2PdfUtil { /** * 静态css文件 */ public static String cssF /** * 图片路径 */ public static String imageP /** * html转PDF * * @param htmlFle * @param pdfFile */ public static void parse2Pdf(String htmlFle, String pdfFile) { try { parse2Pdf(new FileInputStream(htmlFle), new FileOutputStream(pdfFile)); } catch (FileNotFoundException e) { throw new RcBizException("转换失败", ErrorCode.UNKNOWN_ERROR, e); } } /** * html转PDF * * @param htmlFle * @param pdfFile */ public static void parse2Pdf(InputStream htmlFle, OutputStream pdfFile) { try { // step 1 Document document = new Document(); // step 2 PdfWriter writer = PdfWriter.getInstance(document, pdfFile); // step 3 document.open(); // step 4 MyXMLParser.getInstance(document, writer).parse(tidyHtml(htmlFle), Charset.forName("UTF-8")); //step 5 document.close(); } catch (Exception e) { throw new RcBizException("转换失败", ErrorCode.UNKNOWN_ERROR, e); } } /** * html转PDF * * @param htmlContext html 字符串 * @param pdfFile */ public static void parseHtml2Pdf(String htmlContext, OutputStream pdfFile) { try { // step 1 Document document = new Document(); // step 2 PdfWriter writer = PdfWriter.getInstance(document, pdfFile); // step 3 document.open(); MyXMLParser.getInstance(document, writer).parse(tidyHtml(htmlContext), Charset.forName("UTF-8")); //step 5 document.close(); } catch (Exception e) { throw new RcBizException("转换失败", ErrorCode.UNKNOWN_ERROR, e); } } /** * html转PDF * * @param htmlContext html 字符串 * @param pdfFile */ public static void parseHtml2Pdf(String htmlContext, File pdfFile) { try { parseHtml2Pdf(htmlContext, new FileOutputStream(pdfFile)); } catch (Exception e) { throw new RcBizException("转换失败", ErrorCode.UNKNOWN_ERROR, e); } } /** * 闭合HTML标签 * * @param htmlStream * @return */ private static InputStream tidyHtml(InputStream htmlStream) { try { org.jsoup.nodes.Document doc = Jsoup.parse(htmlStream, "UTF-8", ""); doc.outputSettings().escapeMode(Entities.EscapeMode.xhtml); doc.outputSettings().prettyPrint(true); doc.outputSettings().syntax(org.jsoup.nodes.Document.OutputSettings.Syntax.xml); return new ByteArrayInputStream(doc.toString().getBytes("UTF-8")); } catch (Exception e) { e.printStackTrace(); } } /** * 闭合HTML标签 * * @param htmlContext * @return */ private static InputStream tidyHtml(String htmlContext) { try { org.jsoup.nodes.Document doc = Jsoup.parse(htmlContext, ""); doc.outputSettings().escapeMode(Entities.EscapeMode.xhtml); doc.outputSettings().prettyPrint(true); doc.outputSettings().syntax(org.jsoup.nodes.Document.OutputSettings.Syntax.xml); return new ByteArrayInputStream(doc.toString().getBytes("UTF-8")); } catch (Exception e) { e.printStackTrace(); } } protected static class MyXMLParser { public static XMLParser getInstance(Document doc, PdfWriter pdfWriter) throws Exception { //固定css CssFilesImpl cssFiles = new CssFilesImpl(); if (StringUtils.isNotBlank(cssFile)) { cssFiles.add(XMLWorkerHelper.getCSS(new FileInputStream(new File(cssFile)))); } else { cssFiles.add(XMLWorkerHelper.getInstance().getDefaultCSS()); } StyleAttrCSSResolver cssResolver = new StyleAttrCSSResolver(cssFiles); //宋体支持 HtmlPipelineContext hpc = new HtmlPipelineContext(new CssAppliersImpl( new SongFontsProvider())); //图片加载 if (StringUtils.isNotBlank(imagePath)) { hpc.setImageProvider(new ImageProvider(imagePath)); } hpc.setAcceptUnknown(true).autoBookmark(true) .setTagFactory(Tags.getHtmlTagProcessorFactory()); HtmlPipeline htmlPipeline = new HtmlPipeline(hpc, new PdfWriterPipeline(doc, pdfWriter)); Pipeline pipeline = new CssResolverPipeline(cssResolver, htmlPipeline); return new XMLParser(true, new XMLWorker(pipeline, true)); } } /** * 找不到的字体一律改为宋体 */ protected static class SongFontsProvider extends XMLWorkerFontProvider { public SongFontsProvider() { super(null, null); } @Override public Font getFont(final String fontname, String encoding, float size, final int style) { if (fontname == null) { try { final BaseFont baseFont = BaseFont.createFont("STSongStd-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); return new Font(baseFont, size, style); } catch (Exception e) { throw new RuntimeException(e); } } return super.getFont(fontname, encoding, size, style); } } protected static class ImageProvider extends AbstractImageProvider { private String imageRootP public ImageProvider(String imageRootPath) { this.imageRootPath = imageRootP } public String getImageRootPath() { return imageRootP } }}
上一集:没有了 下一集:
相关文章:&&&&&&&&&&&&&&&&
最新添加资讯
24小时热门资讯
附近好友搜索html 生成 pdf 实现思路和代码,基于itext - china os os - ITeye博客
博客分类:
java中生成pdf最快的非itext莫属,itext常用的版本有2.0.8 ,2.1.7 ,以及5.x.x ,中间貌似有断层,而且5改动非常大,包结构都改变了。
我从google查到的html 生成pdf方案,最好的莫过于 flyingsaucer + itext, 目前flygingsaucer-r8(googlecode中有,源码在github)适配的itext版本为2.0.8, 不能使用itext 2.1.7,有些api改变了,运行时会报错。
flying 最好的地方莫过于支持css2.1,及css3少量,flying 实现了一个css解析器,可能为了减少解析的难度,它要求html必须为xhtml格式,而不支持普通的html,你可以使用jtidy将html专程xhtml(有兴趣请自己去查)。
itext默认是不支持中文的,虽然它里面有cjk字体类(中国,日本,韩国)。
这里解决中文有两个方法:1,直接引用中文字体文件
font.addFont(Html2Pdfs.class.getResource("SIMSUN.TTC").toString().substring(6),
BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);
2: 使用 itextAria.jar来支持中文
font.addFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
解决了itext支持中文的问题,flying同样在支持中文上有问题,flying只支持字体文件 ttc或ttf等。我改了flying的源码重新打包了,使其能支持itextaria。jar,避免依赖中文字体文件。
其实在生成pdf的时候我比较了两种方法的执行时间,感觉用字体文件生成速度稳定一些,在500ms左右,而itextaria第一次执行则超过了1s,以后会降到400ms左右。而 itext直接生成则在10ms级。
性能方面大家要多加考虑,这绝对不能应用到高并发的情况。要不然你就等着重启机器吧
解决了中文就该说说生成pdf常见的问题,如分页,如页眉,页脚,超链,图片,margin不过我懒得写了,附件中有个pdf里面都有解决方法。
直接贴代码吧
StringBuilder sb = new StringBuilder();
BufferedReader reader = new BufferedReader(new FileReader(new File("abc.html")));
String line =
while((line = reader.readLine()) != null){
sb.append(line).append("\r\n");
ITextRenderer render = new ITextRenderer();
ITextFontResolver font = render.getFontResolver();
font.addFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
font.addFont(Html2Pdfs.class.getResource("SIMSUN.TTC").toString().substring(6),
BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
} catch (DocumentException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
OutputStream os = new FileOutputStream(pdf);
render.setDocumentFromString(sb.toString());
render.layout();
render.createPDF(os);
os.close();
很简单吧,不过生成速度非常慢,我测试过纯itext的生成速度非常快,那么应该是解析css慢。没办法谁叫只有这一家支持css呢,要不就只能去用itext了。
下载次数: 647
下载次数: 883
下载次数: 912
(108.9 KB)
下载次数: 792
论坛回复 /
(12 / 10656)
有具体可以编辑 PDF页面的代码例子吗?
还有在ftl模板文件里面如何标记一个对象集合!编辑pdf已经超出了本贴的范围,那是另一个领域了。ftl不会请去看freemarker的中文文档,挺多的。我的博客里也有入门教程
看看我的实现方式:
/admin/blogs/982238我也是这个思路实现的,flyingsaucer+itext的效率太低了,而且只能支持中文字体文件才能解决种问题,还有中文换行的问题。你都解决了?
Html2Pdfs 是个什么类?没有提到啊!那行代码是加载html2pdfs所在包下的 ttc字体文件,你可以用任意路径进行替换
feiyan35488
浏览: 126995 次
来自: 北京
abc.html中有相关字体CSS吗?font.addFont ...
好久不用ftl了,发现jsp其实还是蛮强大的
呵呵,我也是
单步调试呢?itext实现html转换成pdf (将带分页execl的html转换成pdf) - xzh - ITeye博客
博客分类:
1.首先下载itext2.08,iTextAsian(亚洲国际化包支持pdf中显示中文),core-Renderer(解析xhtml转换成pdf支持包),jtidy(html转换成xhtml支持包).其中core-Renderer包必须配合itext2.08版本的包,否则会抛出没有是public int[] getCharBBox(char c) 方法异常。
2.使用HttpURLConnection类发送一个post 请求。并利用HttpURLConnection中getInputStream方法获取生成的html的流。
3.利用jtidy将html流转换成xhtml流。并将xhtml流生成xhtml的document文档,最后利用ITextRenderer解析xhtml的document文档生成pdf的OutPutStream流生成pdf.
注意:如果网页html的栏位太多,使网页html转换成pdf只会显示一半,这样就必须将字体变小
如将上面字体12px改成11px或更小就可以:
style.setTextContent("body { font-family: SimHfont-size:11}");
4.通过拦截器获html并将html转换成excel和pdf
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
ServletException {
String queryString = ((HttpServletRequest) request).getQueryString();
String uri = ((HttpServletRequest) request).getRequestURI();
if (queryString == null) {
chain.doFilter(request, response);
response.setCharacterEncoding("UTF-8");
WapperedResponse wrapper = new WapperedResponse((HttpServletResponse) response);
chain.doFilter(request, wrapper);
byte[] excelBytes = wrapper.getResponseData();
ByteArrayInputStream bis = new ByteArrayInputStream(excelBytes);
java.io.BufferedOutputStream bos =
HttpServletResponse httpResp = (HttpServletResponse)
httpResp.reset();
if (!p.matcher(queryString).find()) {
response.setCharacterEncoding("UTF-8");
httpResp.setHeader("Pragma", "no-cache");
httpResp.setHeader("Cache-Control", "no-cache");
httpResp.setDateHeader("Expires", 0);
httpResp.setContentType("application/vnd.ms-excel");
httpResp.setHeader("Content-disposition", " filename="
+ encodingFileName(getFileName(uri).replaceAll(".pdf", ".xls")));
String filePath = ApplicationSetting.getProperty("save_report_excelTemp");
if (!new File(filePath).exists())
new File(filePath).mkdirs();
String htmlName = filePath + UUID.randomUUID().toString().replace("-", "") + ".html";
String excelName = filePath + UUID.randomUUID().toString().replace("-", "") + ".xls";
FileOutputStream stream = new FileOutputStream(new File(htmlName));
stream.write(excelBytes);
stream.close();
excelBytes =
System.gc();
htmlToExcel(htmlName, excelName);// 一般耗時在打開html檔上
} catch (Exception e) {
e.printStackTrace();
} finally {
if (new File(htmlName).exists())
new File(htmlName).delete();
FileInputStream inStream = new FileInputStream(new File(excelName));
byte[] content = new byte[1000];
while (inStream.read(content) != -1) {
response.getOutputStream().write(content);
if (inStream != null)
inStream.close();
if (response.getOutputStream() != null)
response.getOutputStream().close();
if (new File(excelName).exists())
new File(excelName).delete();
httpResp.setHeader("Content-Disposition", " filename=\"my.pdf\"");
httpResp.setHeader("Expires", "0");
httpResp.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
httpResp.setHeader("Pragma", "public");
String fileName = getFileName(uri);
OutputStream ou = response.getOutputStream();
bos = new java.io.BufferedOutputStream(ou);
httpResp.setContentType("application/pdf");
httpResp.setHeader("Content-disposition", " filename=" + encodingFileName(fileName));
String pdfFontSize = ((HttpServletRequest) request).getParameter("pdfFontSize");
PdfRender.html2pdf(bis, "utf-8", pdfFontSize).writeTo(bos);
} catch (Exception e) {
e.printStackTrace();
4.部分参考资料网址
xiongzhenhui
浏览: 143525 次
来自: 厦门
2005年以前,国外开原报表完全碾压国产软件,但是现在国内软件 ...
多谢, 试了N多个后, 终于参考您的内容, 设置出来了。老天开 ...
System.out.println(&草 ...
什么破玩意啊,能不能自己实践下再发#if line.state ...html 转换成pdf - 蹉跎错,消磨过,最是光阴化浮沫 - ITeye博客
博客分类:
解决需求:
1.字符串html代码转换成pdf文件
2.根据FreeMarker模板动态生成静态html文件
3.把静态html文件装换成pdf文件
4.解决html编写不够严谨规范的问题,自动转换为符合规范的格式
5.支持中文及换行
6.pdf文件打水印 - (html文件设置背景图片即可)
7.使用用户根据自己的需求改写jar包中的代码添加 页眉页脚,及当前第几页
使用jar包的版本,特定的jar包是经过改写而实现支持中文及换行问题,附件中给出的就是一组特定版本的jar包,能够解决以上需求
还是有点毛病:
加粗不管用,css样式和B标签都不管用这。。
参考了很多网上的文章:
等等。。。
先来个效果图:
1.得到html的文本内容
import java.io.BufferedR
import java.io.F
import java.io.FileInputS
import java.io.IOE
import java.io.InputStreamR
* &li&功能描述: 工具类 得到html内容&/li&
* @author gjw
public class GetHtmlContent{
* &li&功能描述: 得到html内容&/li&
* @param ******
* @param ******
* @return ******
* @author gjw
public static String getHtmlContent(String tender_id,String invest_id)
String path = "./upload/44/445/"+tender_id+"/"+invest_
File f = new File(path+"/ceshi.html");
if (f.exists())
FileInputStream ism = new FileInputStream(f);
InputStreamReader isr = new InputStreamReader(ism,"utf-8");
BufferedReader bs = new BufferedReader(isr);
info = bs.readLine();
String content = "";
while(info!=null){
bs.readLine();
} catch (IOException e)
e.printStackTrace();
2.String类型的html转换成pdf
import java.io.ByteArrayOutputS
import java.io.FileOutputS
import java.io.IOE
import java.io.OutputS
import java.sql.C
import java.sql.PreparedS
import java.sql.ResultS
import java.sql.SQLE
import javax.xml.parsers.ParserConfigurationE
import org.htmlcleaner.CleanerP
import org.htmlcleaner.HtmlC
import org.htmlcleaner.PrettyXmlS
import org.htmlcleaner.TagN
import org.xhtmlrenderer.pdf.ITextFontR
import org.xhtmlrenderer.pdf.ITextR
import org.xml.sax.SAXE
import LuceneDAO.BaseDAO;
import com.lowagie.text.DocumentE
import com.lowagie.text.pdf.BaseF
public class PdfRenderer {
public static void main(String[] args) throws IOException, DocumentException, ParserConfigurationException, SAXException {
// Create a buffer to hold the cleaned up HTML 将不严格的html编写方式转为严谨的html编码方式
ByteArrayOutputStream out = new ByteArrayOutputStream();
// Clean up the HTML to be well formed
HtmlCleaner cleaner = new HtmlCleaner();
CleanerProperties props = cleaner.getProperties();
TagNode node = cleaner.clean(getcontext());
// Instead of writing to System.out we now write to the ByteArray buffer
new PrettyXmlSerializer(props).writeXmlToStream(node, out);
// Create the PDF
ITextRenderer renderer = new ITextRenderer();
renderer.setDocumentFromString(new String(out.toByteArray()));
//BaseFont fontResolver = renderer.getFontResolver();
ITextFontResolver fontResolver = renderer.getFontResolver();
//解决中文不显示问题
fontResolver.addFont("C:/Windows/Fonts/arialuni.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
//设置资源路径 如图片样式文件
//renderer.getSharedContext().setBaseURL("C:\\htmltopdf\\");
renderer.layout();
OutputStream outputStream = new FileOutputStream(".\\towork\\HTMLasPDF.pdf");
renderer.createPDF(outputStream);
// Finishing up
renderer.finishPDF();
out.flush();
out.close();
public static String getcontext()
Connection con =
PreparedStatement ps =
ResultSet rs =
String sql = "select * from post where fileid = 1";
BaseDAO baseDao =
baseDao = new BaseDAO();
con = baseDao.getConnection();
ps = con.prepareStatement(sql);
rs = ps.executeQuery();
while(rs.next()){
return rs.getString("fdesc").toString();
}catch(Exception e){
e.printStackTrace();
ps.close();
} catch (SQLException e)
e.printStackTrace();
rs.close();
} catch (SQLException e)
e.printStackTrace();
con.close();
} catch (SQLException e)
e.printStackTrace();
连接数据库类文件
import java.sql.C
import java.sql.DriverM
import java.sql.SQLE
public class BaseDAO {
// 必须参数
public static final String DRIVER = "com.mysql.jdbc.Driver"; // 驱动名称
public static final String URL = "jdbc:mysql://localhost:3306/lucene"; // 数据库地址
public static final String DBNAME = "root"; // 用户名
public static final String PASSWORD = "tiger"; // 密码
* 获取数据库连接
* @return con
* @throws ClassNotFoundException
* @throws SQLException
public Connection getConnection() throws ClassNotFoundException,
SQLException {
Class.forName(DRIVER);
Connection con = DriverManager.getConnection(URL, DBNAME, PASSWORD);
3.html静态文件生成pdf
import java.io.ByteArrayOutputS
import java.io.FileInputS
import java.io.FileOutputS
import java.io.IOE
import java.io.InputS
import java.io.OutputS
import javax.xml.parsers.ParserConfigurationE
import org.htmlcleaner.CleanerP
import org.htmlcleaner.HtmlC
import org.htmlcleaner.PrettyXmlS
import org.htmlcleaner.TagN
import org.xhtmlrenderer.pdf.ITextFontR
import org.xhtmlrenderer.pdf.ITextR
import org.xml.sax.SAXE
import com.lowagie.text.DocumentE
import com.lowagie.text.pdf.BaseF
public class PdfRenderer {
public static void main(String[] args) throws IOException, DocumentException, ParserConfigurationException, SAXException {
// Create a buffer to hold the cleaned up HTML将不严格的html编写方式转为严谨的html编码方式
ByteArrayOutputStream out = new ByteArrayOutputStream();
// Clean up the HTML to be well formed
HtmlCleaner cleaner = new HtmlCleaner();
CleanerProperties props = cleaner.getProperties();
InputStream inputStream = new FileInputStream(".\\towork\\user.html");
TagNode node = cleaner.clean(inputStream, "utf-8");
// Instead of writing to System.out we now write to the ByteArray buffer
new PrettyXmlSerializer(props).writeXmlToStream(node, out);
// Create the PDF
ITextRenderer renderer = new ITextRenderer();
renderer.setDocumentFromString(new String(out.toByteArray()));
ITextFontResolver fontResolver = renderer.getFontResolver();
fontResolver.addFont("C:/Windows/Fonts/arialuni.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
renderer.layout();
OutputStream outputStream = new FileOutputStream(".\\towork\\HTMLasPDF.pdf");
renderer.createPDF(outputStream);
// Finishing up
renderer.finishPDF();
out.flush();
out.close();
4.利用freemark生成静态的html文件
import java.io.F
import java.io.FileOutputS
import java.io.IOE
import java.io.OutputStreamW
import java.io.W
import java.util.M
import freemarker.template.C
import freemarker.template.DefaultObjectW
import freemarker.template.T
import freemarker.template.TemplateE
* 生成 静态html文件的方法
public class FreeMarkerUtil{
//templatePath模板文件存放路径
//templateName 模板文件名称
//filename 生成的文件名称
public static void analysisTemplate(String templatePath,String templateName,String fileName,Map&?,?&root){
Configuration config=new Configuration();
//设置要解析的模板所在的目录,并加载模板文件
config.setDirectoryForTemplateLoading(new File(templatePath));
//设置包装器,并将对象包装为数据模型
config.setObjectWrapper(new DefaultObjectWrapper());
//获取模板,并设置编码方式,这个编码必须要与页面中的编码格式一致
//否则会出现乱码
Template template=config.getTemplate(templateName,"UTF-8");
//合并数据模型与模板
FileOutputStream fos = new FileOutputStream(fileName);
Writer out = new OutputStreamWriter(fos,"UTF-8");
template.process(root, out);
out.flush();
out.close();
} catch (IOException e) {
e.printStackTrace();
}catch (TemplateException e) {
e.printStackTrace();
import java.util.HashM
import java.util.M
import com.seening.utils.SWResultL
import com.sinocec.model.xrwd.SWAreaF
* 测试ftl生成html文件
public class ClientTest{
public static void main(String[] args){
User user=new User();
user.setUserName("李四");
user.setUserPassword("123");
Map&String,Object& root=new HashMap&String, Object&();
root.put("user", user);;
String templatesPath="./WEB-INF/templet";
String templateFile="templet.ftl";
String htmlFile="./upload/templet/commontemplet.html";
FreeMarkerUtil.analysisTemplate(templatesPath,templateFile,htmlFile,root);
&&& core-renderer3.jar
&&& htmlcleaner.jar
&&& iText-2.0.8.jar
&&& iTextAsian.jar
&&& jtidy-r8-.jar
&&& mysql-connector-java-5.1.6-bin.jar
下面有测试项目
/opensource/expdoc/itext-xml-worker-cn/
下载次数: 135
(241.2 KB)
下载次数: 78
下载次数: 123
(858.7 KB)
下载次数: 49
(321.6 KB)
下载次数: 82
下载次数: 79
下载次数: 121
浏览: 88815 次
来自: 北京
不好意思说错了,是变量替换后,如果是英文和数字,是不换行的,如 ...
楼主你好,有问题、一直难以解决,我们项目上线后,就遗留在这就是 ...
scoreName 这个属性是做什么的!
yixiandave 写道高军威 写道alvin198761
高军威 写道alvin198761 写道53./** 54.}

我要回帖

更多关于 如何使用雷电转换器 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信