IText 生成rtf 内容中含有HTML标签处理
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.StringReader;
import java.util.List;
import com.lowagie.text.Document;
import com.lowagie.text.PageSize;
import com.lowagie.text.Paragraph;
import com.lowagie.text.html.simpleparser.HTMLWorker;
import com.lowagie.text.html.simpleparser.StyleSheet;
import com.lowagie.text.rtf.RtfWriter2;
public class ItextCreateRTF {
public static void main(String[] args) throws Exception {
OutputStream out=new FileOutputStream("D://a.rtf");
Document document = new Document(PageSize.A4);
RtfWriter2.getInstance(document,out );
document.open();
// 设置中文字体
Paragraph context = new Paragraph();
String s="<span style="\" mce_style="\""color: rgb(165, 42, 42);\">方法撒旦法<br><img src="\" mce_src="\""D:\\soft\\apache-tomcat-6.0.10\\webapps\\pms\\upload/requirement/979/281/633/SLIEdY9Sdl1266902295468.jpg\" style="\" mce_style="\""max-width: 100%;\"><br><br></span><table style="\" mce_style="\""width: 200px;\" bgcolor=\"#000000\" cellpadding=\"4\" cellspacing=\"1\"><tbody><tr><td bgcolor=\"#ffffff\"><span style="\" mce_style="\""color: rgb(165, 42, 42);\"><span style="\" mce_style="\""background-color: rgb(0, 255, 0);\"><span style="\" mce_style="\""font-size: 16px;\">分撒旦飞洒<br></span></span></span></td><td bgcolor=\"#ffffff\"><span style="\" mce_style="\""color: rgb(165, 42, 42);\"><span style="\" mce_style="\""background-color: rgb(0, 255, 0);\"><span style="\" mce
相关文档:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>use html as DOM</title>
<mce:script language="javascript" type="text/javascript"><!--
function addUser() {
// get and execute na ......
Struts HTML标签
<html:html>标签
属性的作用:
lang: 值为true时,就根据存储在HttpSession中的Locale对象来输出网 页使用的语言。如果不存在session或session中没有Locale对象, 就以Http请求头中的Accept-language属性来设置输出语言。如果 &nbs ......
http://download.csdn.net/source/2062506
参考了早期126邮件编辑器以及网上一些资料。图片资源主要来自网络。
代码部分只有一个html文件。其余为图标。
代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<ME ......
示例:此DIV为固定定位对象
要使HTML元件定位于浏览器的某个固定位置,而不随滚动条滚动,用以下CSS代码即可,跨各个主流浏览器: POSITION: fixed! important; TOP: 100px; _position: absolute; _top: 40; _left: 100。
示例见右边黄底红字块。 ......
<OBJECT id=WebBrowser height=0 width=0
classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2></OBJECT>
<INPUT onclick=document.all.WebBrowser.ExecWB(1,1) type=button value=打开 name=Button1>
<INPUT onclick=document.all.WebBrowser.ExecWB(4,1) type=button value=另存为 name=Butt ......