return getSpecialLine(template, inchunks, offsetX, offsetY, SMALL_FONT_SIZE, SUPSCRIPT_FONT_SIZE);
}
public static Paragraph getSpecialLine(PdfTemplate template, Chunk[] inchunks, float offsetX, float offsetY, float fontsize, float supscriptFontsize) throws Exception {
BaseFont font = BaseFont.createFont("Helvetica", "winansi", false);
float leading = 7;
int linesNo = getRealChunksSize(inchunks);
float yPosition = (linesNo - 1) * DEFAULT_FONT_HEIGHT;
float width = 0;
float height = linesNo * DEFAULT_FONT_HEIGHT;
template.setFontAndSize(font, fontsize);
template.beginText();
template.moveText(0, yPosition);
float tempWidth = 0;
for (int i = 0; i < inchunks.length; i++) {
Chunk inchunk = inchunks[i];
if (!inchunk.equals(Chunk.NEWLINE) && !inchunk.content().equals("")) {
String content = inchunk.content();
String supAttribute = inchunk.getMarkupAttribute(Chunk.SUBSUPSCRIPT);
if (supAttribute != null) {
template.setFontAndSize(font, supscriptFontsize);
template.moveText(tempWidth, 2f);
template.showText(supAttribute);
// Rep�e valores
float attrWidth = font.getWidthPoint(supAttribute, supscriptFontsize);
tempWidth += attrWidth;
if (tempWidth > width) width = tempWidth;
template.moveText(attrWidth, -2f);
template.setFontAndSize(font, fontsize);
} else {
//System.out.println("CONTENT = *" + content + "*");
template.showText(content);
tempWidth += font.getWidthPoint(content, fontsize);
if (tempWidth > width) width = tempWidth;
}
}