Example usage for com.itextpdf.text Paragraph getIndentationLeft

List of usage examples for com.itextpdf.text Paragraph getIndentationLeft

Introduction

In this page you can find the example usage for com.itextpdf.text Paragraph getIndentationLeft.

Prototype

public float getIndentationLeft() 

Source Link

Usage

From source file:com.athena.chameleon.engine.utils.PDFWriterUtil.java

License:Apache License

/**
 * Element Mapping/* w  w  w .j  a  v a 2s  . c  o m*/
 * 
 * @param section section ?
 * @param e element 
 * @return Section
 * @throws Exception
 */
public static Section setElement(PdfWriter writer, Section section, Element e) throws Exception {

    for (org.jdom2.Element e1 : e.getChildren()) {

        if (e1.getName().equals("section")) {
            //  section?   
            setSectionElement(writer, section, e1);

        } else if (e1.getName().equals("text")) {

            /* ? text ?
               attribute : padding -  padding  */
            if (e1.getAttributeValue("padding") != null) {
                Paragraph text = getDefault(e1.getText());
                text.setIndentationLeft(
                        text.getIndentationLeft() + Float.parseFloat(e1.getAttributeValue("padding")));

                section.add(text);
            } else {
                section.add(getDefault(e1.getText()));
            }

        } else if (e1.getName().equals("table")) {
            // ?
            setTable(section, e1);

        } else if (e1.getName().equals("textR")) {
            //?? ? text ?
            section.add(getDefaultRed(e1.getText(), Font.ITALIC));

        } else if (e1.getName().equals("textP")) {
            //? ? text ?
            section.add(getDefaultPoint(e1.getText()));

        } else if (e1.getName().equals("box")) {
            //text box ?
            setBox(section, e1);

        } else if (e1.getName().equals("boxB")) {
            //? ? text box ?
            setBoxB(section, e1);

        } else if (e1.getName().equals("boxW")) {
            //text box ?
            setBoxW(section, e1);

        } else if (e1.getName().equals("list")) {
            //? ?
            setList(section, e1);

        } else if (e1.getName().equals("img")) {
            //? ?
            setImage(section, e1);
        } else if (e1.getName().equals("chart")) {
            // ?
            setChart(writer, section, e1);
        }
    }

    return section;

}