BaseColor color = (BaseColor)back[0];
this.setAttribute(PdfName.BACKGROUNDCOLOR, new PdfArray(new float[] {color.getRed()/255f, color.getGreen()/255f, color.getBlue()/255f}) );
}
// Setting inheritable attributes
IPdfStructureElement parent = (IPdfStructureElement) this.getParent(true);
PdfObject obj = parent.getAttribute(PdfName.COLOR);
if ((chunk.getFont() != null) && (chunk.getFont().getColor() != null)) {
BaseColor c = chunk.getFont().getColor();
setColorAttribute(c, obj, PdfName.COLOR);
}
PdfObject decorThickness = parent.getAttribute(PdfName.TEXTDECORATIONTHICKNESS);
PdfObject decorColor = parent.getAttribute(PdfName.TEXTDECORATIONCOLOR);
if (attr.containsKey(Chunk.UNDERLINE)){
Object[][] unders = (Object[][])attr.get(Chunk.UNDERLINE);
Object[] arr = unders[unders.length-1];
BaseColor color = (BaseColor)arr[0];
float [] floats = (float[]) arr[1];
float thickness = floats[0];
// Setting thickness
if (decorThickness instanceof PdfNumber){
float t = ((PdfNumber) decorThickness).floatValue();
if (Float.compare(thickness,t) != 0){
this.setAttribute(PdfName.TEXTDECORATIONTHICKNESS, new PdfNumber(thickness));
}
}
else
this.setAttribute(PdfName.TEXTDECORATIONTHICKNESS, new PdfNumber(thickness));
// Setting decoration color
if (color != null){
setColorAttribute(color, decorColor, PdfName.TEXTDECORATIONCOLOR);
}
}
if (attr.containsKey(Chunk.LINEHEIGHT)){
float height = (Float)attr.get(Chunk.LINEHEIGHT);
PdfObject parentLH = parent.getAttribute(PdfName.LINEHEIGHT);
if (parentLH instanceof PdfNumber){
float pLH = ((PdfNumber)parentLH).floatValue();
if (Float.compare(pLH, height) != 0){
this.setAttribute(PdfName.LINEHEIGHT, new PdfNumber(height));
}