Browse Source

Pull request #459: REPORT-33027 REPORT-33032 无插件PDF导出- HTML解析:支持<s> 、<strike>、<del>标签;font-size 支持单位 %,text-decoration 支持line-through值

Merge in CORE/base-third from ~HUGH.C/base-third:release/10.0 to release/10.0

* commit '49b931e8ca491eba6a44432c76458645b76d7194':
  REPORT-33032 无插件PDF导出-HTML解析:font-size 支持单位 %,text-decoration 支持line-through值
  REPORT-33027 无插件PDF导出-HTML解析:支持<s> 、<strike>、<del>标签
release/10.0
Hugh.C 5 years ago
parent
commit
dcc963a955
  1. 3
      fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/Markup.java
  2. 8
      fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/FactoryProperties.java
  3. 2
      fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/HTMLWorker.java

3
fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/Markup.java

@ -399,6 +399,9 @@ public class Markup {
if (string.startsWith("em")) {
return f * actualFontSize;
}
if (string.startsWith("%")) {
return f * actualFontSize / 100;
}
// one ex is the x-height of a font (x-height is usually about half the
// font-size)
if (string.startsWith("ex")) {

8
fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/FactoryProperties.java

@ -389,8 +389,13 @@ public class FactoryProperties {
h.put("b", null);
} else if (key.equals(Markup.CSS_KEY_TEXTDECORATION)) {
String ss = prop.getProperty(key).trim().toLowerCase();
if (ss.equals(Markup.CSS_VALUE_UNDERLINE))
if (ss.equals(Markup.CSS_VALUE_UNDERLINE)) {
h.put("u", null);
} else if (ss.equals(Markup.CSS_VALUE_LINETHROUGH)) {
h.put("s", null);
} else {
h.put(key, ss);
}
} else if (key.equals(Markup.CSS_KEY_COLOR)) {
Color c = Markup.decodeColor(prop.getProperty(key));
if (c != null) {
@ -472,5 +477,6 @@ public class FactoryProperties {
followTags.put("strong", "b");
followTags.put("s", "s");
followTags.put("strike", "s");
followTags.put("del", "s");
}
}

2
fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/HTMLWorker.java

@ -821,7 +821,7 @@ public class HTMLWorker implements SimpleXMLDocHandler, DocListener {
return true;
}
public static final String tagsSupportedString = "ol ul li a pre font span br p div body table td th tr i b u sub sup em strong s strike"
public static final String tagsSupportedString = "ol ul li a pre font span br p div body table td th tr i b u sub sup em strong s strike del"
+ " h1 h2 h3 h4 h5 h6 img hr";
public static final HashMap tagsSupported = new HashMap();

Loading…
Cancel
Save