IText5Excel转pdf,带有添加文字水印,图片水印实例。
*jar版本:poi-3.9-20121203.jar,poi-ooxml-3.9-20121203.jar,*poi-ooxml-schemas-3.9-20121203.jar,itextpdf-5.5.9.jar,itext-asian-5.2.0.jar文件中含有依赖的jar,代码,下载后你直接可以用了,花了2地利间整理完成。
共3个方法,一个是生成pdf,第2个是加文字水印,第3个是加图片水印publicstaticvoidmain(String[]args){Stringfilepath="C:\\Users\\igiroad\\Desktop\\申请汇总表(3).xls";Stringpdffilepath=doConvertPdf(filepath,"testtitle","me","mewrite","meme","me",true);doAddWaterMark(pdffilepath,"我是谁?我是谁?我是谁?我是谁?我是谁?",38,"255,200,0","200,150",10);doAddPicMark(pdffilepath,"D:\\Documents\\Pictures\\cry.jpg","110,110","595,842");System.out.println(pdffilepath);}
1