ItextSharp支持fot HTML和CSS [英] ItextSharp support fot HTML and CSS

查看:112
本文介绍了ItextSharp支持fot HTML和CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道ItextSharp对HTML和CSS解析有一些重要的限制。

I'm aware that ItextSharp have some importants limitations about HTML and CSS Parsing.

我正在寻找一些文档或帖子告诉我这个限制,测试每个可能的功能和交叉我的手指。

I'm looking for some document or post that tell me this limitations, instead of test every posible feature and cross my fingers.

我可以使用什么CSS样式?我该如何显示?

What CSS styles can i use? How show I do it?

这同样适用于HTML。今天早上mi应用崩溃,因为我使用< hr /> 标签,似乎不支持ItextSharp。

The same applies to HTML. This morning mi app crash because I was using the <hr /> tag, that seems not to be supported by ItextSharp.

我一直在搜索这样的文档,但我没有发现任何东西。

I've been searching for such document, but I didn't found anything.

谢谢。

推荐答案

HTML解析器是一个移动目标,所以找出支持的最好的方法是查看源代码。这是最新版本的 HTMLTagProcessors.cs HtmlTags.cs StyleSheet.cs

The HTML parser is a moving target so the best way to figure out what is supported is to view the source. Here's the most recent versions of the HTMLTagProcessors.cs, HtmlTags.cs and StyleSheet.cs.

HtmlTags.cs 定义有效的HTML和CSS字符串。文件的顶部将显示支持的HTML标签,中间是HTML属性,后跟有效的HTML属性值,最后是CSS声明。

HtmlTags.cs defines valid HTML and CSS strings. The top part of the file will show you the supported HTML tags, the middle is HTML attributes followed by valid HTML attribute values and finally CSS declarations.

HTMLTagProcessors.cs 将显示处理规则。

StyleSheet.cs 显示样式表如何基本上转换为HTML规则。具体来看第171行附近的 ResolveStyleAttribute 方法。

StyleSheet.cs will show you how styles sheets are essentially converted to HTML rules. Specifically look at the ResolveStyleAttribute method around line 171.

我不知道为什么你的应用程序在遇到< hr /> 标记,但希望您能得到一些可以追溯到源代码的调试信息。

I don't know why your app crashed upon encountering an <hr /> tag but hopefully you got some debug information that you can trace back to the source.

这篇关于ItextSharp支持fot HTML和CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆