|
|
@ -60,7 +60,6 @@ import com.fr.third.v2.lowagie.text.pdf.PdfPCell; |
|
|
|
import com.fr.third.v2.lowagie.text.Phrase; |
|
|
|
import com.fr.third.v2.lowagie.text.Phrase; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* |
|
|
|
|
|
|
|
* @author psoares |
|
|
|
* @author psoares |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class IncCell implements TextElementArray { |
|
|
|
public class IncCell implements TextElementArray { |
|
|
@ -68,7 +67,9 @@ public class IncCell implements TextElementArray { |
|
|
|
private ArrayList chunks = new ArrayList(); |
|
|
|
private ArrayList chunks = new ArrayList(); |
|
|
|
private PdfPCell cell; |
|
|
|
private PdfPCell cell; |
|
|
|
|
|
|
|
|
|
|
|
/** Creates a new instance of IncCell */ |
|
|
|
/** |
|
|
|
|
|
|
|
* Creates a new instance of IncCell |
|
|
|
|
|
|
|
*/ |
|
|
|
public IncCell(String tag, ChainedProperties props) { |
|
|
|
public IncCell(String tag, ChainedProperties props) { |
|
|
|
cell = new PdfPCell((Phrase) null); |
|
|
|
cell = new PdfPCell((Phrase) null); |
|
|
|
String value = props.getProperty("colspan"); |
|
|
|
String value = props.getProperty("colspan"); |
|
|
@ -104,8 +105,7 @@ public class IncCell implements TextElementArray { |
|
|
|
if (value != null) |
|
|
|
if (value != null) |
|
|
|
cell.setPadding(CSSUtils.parseFloat(value)); |
|
|
|
cell.setPadding(CSSUtils.parseFloat(value)); |
|
|
|
cell.setUseDescender(true); |
|
|
|
cell.setUseDescender(true); |
|
|
|
value = props.getProperty("bgcolor"); |
|
|
|
|
|
|
|
cell.setBackgroundColor(Markup.decodeColor(value)); |
|
|
|
|
|
|
|
//解析td上声明的width
|
|
|
|
//解析td上声明的width
|
|
|
|
value = props.getLastChainProperty("width"); |
|
|
|
value = props.getLastChainProperty("width"); |
|
|
|
if (value != null) { |
|
|
|
if (value != null) { |
|
|
@ -118,6 +118,10 @@ public class IncCell implements TextElementArray { |
|
|
|
} |
|
|
|
} |
|
|
|
//解析background相关属性并保存到cell对象
|
|
|
|
//解析background相关属性并保存到cell对象
|
|
|
|
Map<String, String> backgroundRules = new HashMap<String, String>(); |
|
|
|
Map<String, String> backgroundRules = new HashMap<String, String>(); |
|
|
|
|
|
|
|
value = props.getProperty("bgcolor"); |
|
|
|
|
|
|
|
if (value != null) { |
|
|
|
|
|
|
|
backgroundRules.put("background-color", value); |
|
|
|
|
|
|
|
} |
|
|
|
value = props.getLastChainProperty("background-size"); |
|
|
|
value = props.getLastChainProperty("background-size"); |
|
|
|
if (value != null) { |
|
|
|
if (value != null) { |
|
|
|
backgroundRules.put("background-size", value); |
|
|
|
backgroundRules.put("background-size", value); |
|
|
@ -170,16 +174,16 @@ public class IncCell implements TextElementArray { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see Element#isContent() |
|
|
|
|
|
|
|
* @since iText 2.0.8 |
|
|
|
* @since iText 2.0.8 |
|
|
|
|
|
|
|
* @see Element#isContent() |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isContent() { |
|
|
|
public boolean isContent() { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see Element#isNestable() |
|
|
|
|
|
|
|
* @since iText 2.0.8 |
|
|
|
* @since iText 2.0.8 |
|
|
|
|
|
|
|
* @see Element#isNestable() |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isNestable() { |
|
|
|
public boolean isNestable() { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|