throws DocumentException, IOException {
// No caso de se tratar de uma string vazia n�o � necess�rio efectuar o add do template
if ((value != null) && (value.trim().equals(""))) return;
JdomElement _sampleAttr = element.getChild("Sample");
// No caso de n�o existir valor no ListMap e no sample n�o se efectua o add do template
if ((value == null) && (_sampleAttr == null)) return;
int width = element.getChild("Width").getIntValue();
int height = element.getChild("Height").getIntValue();
int fontSize = element.getChild("FontSize", globalData.fontSize).getIntValue();
BaseFont bf;
if (font != null) {
bf = font;
} else {
String fontName = element.getChild("Font", globalData.font).getString();
bf = BaseFont.createFont(fontName, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
}
PdfTemplate template = cb.createTemplate(width, height);
template.beginText();
template.setFontAndSize(bf, fontSize);
if (color != null) {
template.setColorFill(color);
}
String text = transform(
value == null ? _sampleAttr.getString() : value,
element.getChild("Type").getString(),
element.getChild("Format") != null ? element.getChild("Format").getString() : null);
int alignCode = getAlignCode(element.getChild("HAlign"));
switch (alignCode) {