Browse Source
* commit '0e908f95140466ba382a47e60df282767bde1330': REPORT-29490 安全漏洞by zack REPORT-29784 third删减引起定时调度失败 REPORT-27284 table解析导出PDF后 单元格背景、边框与预览不一致 DEC-12783 【迭代】迁移db2数据库后,多语言插件添加key失败 REPORT-29126 导出pdf,字体加粗效果没有了(漏提) REPORT-29126 导出pdf,字体加粗效果没有了 暂时兼容旧版本新引擎插件final/10.0
Kara
5 years ago
8 changed files with 101 additions and 46 deletions
@ -0,0 +1,48 @@ |
|||||||
|
package com.fr.third.v2.lowagie.text.html.Utils; |
||||||
|
|
||||||
|
import com.fr.third.v2.lowagie.text.html.CSSUtils; |
||||||
|
import com.fr.third.v2.lowagie.text.html.simpleparser.ChainedProperties; |
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Hugh.C |
||||||
|
* @version 1.0 |
||||||
|
* Created by Hugh.C on 2020/2/26 |
||||||
|
*/ |
||||||
|
public class BackgroundUtil { |
||||||
|
|
||||||
|
public static Map<String, String> parse2RulesMap(ChainedProperties props) { |
||||||
|
Map<String, String> backgroundRules = new HashMap<String, String>(); |
||||||
|
String value = props.getProperty("bgcolor"); |
||||||
|
if (value != null) { |
||||||
|
backgroundRules.put("background-color", value); |
||||||
|
} |
||||||
|
value = props.getLastChainProperty("background-size"); |
||||||
|
if (value != null) { |
||||||
|
backgroundRules.put("background-size", value); |
||||||
|
} |
||||||
|
value = props.getLastChainProperty("background"); |
||||||
|
if (value != null) { |
||||||
|
Map<String, String> backgroundStyles = CSSUtils.processBackground(value); |
||||||
|
backgroundRules.putAll(backgroundStyles); |
||||||
|
} |
||||||
|
value = props.getLastChainProperty("background-color"); |
||||||
|
if (value != null) { |
||||||
|
backgroundRules.put("background-color", value); |
||||||
|
} |
||||||
|
value = props.getLastChainProperty("background-position"); |
||||||
|
if (value != null) { |
||||||
|
backgroundRules.put("background-position", value); |
||||||
|
} |
||||||
|
value = props.getLastChainProperty("background-repeat"); |
||||||
|
if (value != null) { |
||||||
|
backgroundRules.put("background-repeat", value); |
||||||
|
} |
||||||
|
value = props.getLastChainProperty("background-image"); |
||||||
|
if (value != null) { |
||||||
|
backgroundRules.put("background-image", value); |
||||||
|
} |
||||||
|
return backgroundRules; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue