0
Document document = new Document();
string str = Pagehtml;
//writer - have our own path!!!
PdfWriter.GetInstance(document, new FileStream(Server.MapPath(".") + "parsetest.pdf", FileMode.Create));
document.Open();
//here when it parse the html gives exception unknown color format should be #RGB
ArrayList htmlarraylist = iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(new StringReader(str), null);
//add the collection to the document
for (int k = 0; k < htmlarraylist.Count; k++)
{
document.Add((IElement)htmlarraylist[k]);
}
这是我的代码中,我解析HTML代码,但是当它解析HTML它给未知色彩格式的例外未知色彩格式异常从HTML到PDF使用iTextSharp的
感谢您的回复,我得到了我的问题的解决方案,这是由于内联CSS我在页面中使用我有定义非RGB格式的颜色现在这个问题是由RGB定义它们解决格式。 –