Example usage for com.lowagie.text Element ALIGN_UNDEFINED

List of usage examples for com.lowagie.text Element ALIGN_UNDEFINED

Introduction

In this page you can find the example usage for com.lowagie.text Element ALIGN_UNDEFINED.

Prototype

int ALIGN_UNDEFINED

To view the source code for com.lowagie.text Element ALIGN_UNDEFINED.

Click Source Link

Document

A possible value for paragraph alignment.

Usage

From source file:ca.nines.ise.writer.RTFWriter.java

License:Open Source License

public RTFWriter(PrintStream out) throws ParserConfigurationException, UnsupportedEncodingException {
    super(out);//  w  w w.ja v  a2  s .c  o m
    doc = new Document();
    writer = RtfWriter2.getInstance(doc, out);
    writer.getDocumentSettings().setOutputDebugLineBreaks(true);
    normal = new RtfParagraphStyle("ISE Normal", "Times New Roman", 12, Font.NORMAL, Color.BLACK);
    normal.setAlignment(Element.ALIGN_UNDEFINED);
    writer.getDocumentSettings().registerParagraphStyle(normal);

    ld = new RtfParagraphStyle("ISE h2", "ISE Normal");
    ld.setFontName("Helvetica");
    ld.setSize(16);
    ld.setStyle(Font.BOLD);
    writer.getDocumentSettings().registerParagraphStyle(ld);

    exit = new RtfParagraphStyle("ISE exit", "ISE Normal");
    exit.setAlignment(Element.ALIGN_RIGHT);
    exit.setStyle(Font.ITALIC);
    writer.getDocumentSettings().registerParagraphStyle(exit);

    p1 = new RtfParagraphStyle("ISE p1", "ISE Normal");
    p1.setFirstLineIndent(-19);
    p1.setIndentLeft(19);
    p1.setIndentRight(49);
    writer.getDocumentSettings().registerParagraphStyle(p1);

    prose = new RtfParagraphStyle("ISE Prose", "ISE Normal");
    prose.setFirstLineIndent(-19);
    prose.setIndentLeft(19);
    prose.setIndentRight(49);
    writer.getDocumentSettings().registerParagraphStyle(prose);

    p2 = new RtfParagraphStyle("ISE p2", "ISE Normal");
    p2.setFirstLineIndent(-19);
    p2.setIndentLeft(38);
    p2.setIndentRight(49);
    writer.getDocumentSettings().registerParagraphStyle(p2);

    fnStyle = new RtfParagraphStyle("ISE Footnote", "ISE Normal");
    fnStyle.setFontName("Times New Roman");
    fnStyle.setFirstLineIndent(-19);
    fnStyle.setIndentLeft(19);
    fnStyle.setIndentRight(0);
    fnStyle.setSize(10);
    writer.getDocumentSettings().registerParagraphStyle(fnStyle);
}

From source file:fr.opensagres.odfdom.converter.pdf.internal.stylable.StylableParagraph.java

License:Open Source License

public void applyStyles(Style style) {
    this.lastStyleApplied = style;

    StyleTextProperties textProperties = style.getTextProperties();
    if (textProperties != null) {
        // font/*www.ja  v a  2 s .com*/
        Font font = textProperties.getFont();
        if (font != null) {
            super.setFont(font);
        }
    }

    StyleParagraphProperties paragraphProperties = style.getParagraphProperties();
    if (paragraphProperties != null) {
        // break-before
        StyleBreak breakBefore = paragraphProperties.getBreakBefore();
        if (breakBefore != null) {
            handleBreak(breakBefore);
        }

        // alignment
        int alignment = paragraphProperties.getAlignment();
        if (alignment != Element.ALIGN_UNDEFINED) {
            super.setAlignment(alignment);
        }

        // first line indentation
        Boolean autoTextIndent = paragraphProperties.getAutoTextIndent();
        if (Boolean.TRUE.equals(autoTextIndent)) {
            float fontSize = font != null ? font.getCalculatedSize() : Font.DEFAULTSIZE;
            super.setFirstLineIndent(1.3f * fontSize);
        } else {
            Float textIndent = paragraphProperties.getTextIndent();
            if (textIndent != null) {
                // text indent can be negative. 
                // See https://code.google.com/p/xdocreport/issues/detail?id=366 
                super.setFirstLineIndent(textIndent);
            }
        }

        // line height
        StyleLineHeight lineHeight = paragraphProperties.getLineHeight();
        if (lineHeight != null && lineHeight.getLineHeight() != null) {
            if (lineHeight.isLineHeightProportional()) {
                super.setMultipliedLeading(lineHeight.getLineHeight());
            } else {
                super.setLeading(lineHeight.getLineHeight());
            }
        }

        // keep together on the same page
        Boolean keepTogether = paragraphProperties.getKeepTogether();
        if (keepTogether != null) {
            super.setKeepTogether(keepTogether);
        }
    }
}

From source file:fr.opensagres.odfdom.converter.pdf.internal.stylable.StylableTable.java

License:Open Source License

public void applyStyles(Style style) {
    this.lastStyleApplied = style;

    StyleTableProperties tableProperties = style.getTableProperties();
    if (tableProperties != null) {
        // width//from  w  w  w .  ja v  a2 s  .  c  o  m
        if (tableProperties.getWidth() != null) {
            super.setTotalWidth(tableProperties.getWidth());
        }

        // alignment
        int alignment = tableProperties.getAlignment();
        if (alignment != Element.ALIGN_UNDEFINED) {
            super.setHorizontalAlignment(alignment);
        }

        // margins
        Float margin = tableProperties.getMargin();
        if (margin != null && margin > 0.0f) {
            super.setPadding(margin);
        }
        Float marginLeft = tableProperties.getMarginLeft();
        if (marginLeft != null && marginLeft > 0.0f) {
            super.setPaddingLeft(marginLeft);
        }
        Float marginRight = tableProperties.getMarginRight();
        if (marginRight != null && marginRight > 0.0f) {
            super.setPaddingRight(marginRight);
        }
        Float marginTop = tableProperties.getMarginTop();
        if (marginTop != null && marginTop > 0.0f) {
            super.setPaddingTop(marginTop);
        }
        Float marginBottom = tableProperties.getMarginBottom();
        if (marginBottom != null && marginBottom > 0.0f) {
            super.setPaddingBottom(marginBottom);
        }

        // table splitting
        Boolean mayBreakBetweenRows = tableProperties.getMayBreakBetweenRows();
        if (mayBreakBetweenRows != null) {
            super.setKeepTogether(!mayBreakBetweenRows);
        }
    }
    StyleTableRowProperties tableRowProperties = style.getTableRowProperties();
    if (tableRowProperties != null) {
        // keep together
        Boolean keepTogether = tableRowProperties.getKeepTogether();
        if (keepTogether != null) {
            // keep together is table row property in open office
            // but it is table property in iText
            // so we set keep together = true if any of table rows has this property set to true
            if (super.isSplitLate() == false && keepTogether == true) {
                super.setSplitLate(true);
            }
        }
    }
}

From source file:fr.opensagres.odfdom.converter.pdf.internal.stylable.StylableTableCell.java

License:Open Source License

public void applyStyles(Style style) {
    this.lastStyleApplied = style;

    StyleTableRowProperties tableRowProperties = style.getTableRowProperties();
    if (tableRowProperties != null) {
        Float minRowHeight = tableRowProperties.getMinRowHeight();
        if (minRowHeight != null) {
            super.setMinimumHeight(minRowHeight);
        }/*from   ww  w  . j ava 2s  .  c  o  m*/

        Float rowHeight = tableRowProperties.getRowHeight();
        if (rowHeight != null) {
            super.setFixedHeight(rowHeight);
        }
    }
    StyleTableCellProperties tableCellProperties = style.getTableCellProperties();
    if (tableCellProperties != null) {
        // background-color
        Color backgroundColor = tableCellProperties.getBackgroundColor();
        if (backgroundColor != null) {
            super.setBackgroundColor(backgroundColor);
        }

        // border
        StyleBorder border = tableCellProperties.getBorder();
        StyleUtils.applyStyles(border, this);

        // border-top
        StyleBorder borderTop = tableCellProperties.getBorderTop();
        StyleUtils.applyStyles(borderTop, this);

        // border-bottom
        StyleBorder borderBottom = tableCellProperties.getBorderBottom();
        StyleUtils.applyStyles(borderBottom, this);

        // border-left
        StyleBorder borderLeft = tableCellProperties.getBorderLeft();
        StyleUtils.applyStyles(borderLeft, this);

        // border-right
        StyleBorder borderRight = tableCellProperties.getBorderRight();
        StyleUtils.applyStyles(borderRight, this);

        // padding
        Float padding = tableCellProperties.getPadding();
        if (padding != null) {
            super.setPadding(padding);
        }

        // padding-top
        Float paddingTop = tableCellProperties.getPaddingTop();
        if (paddingTop != null) {
            super.setPaddingTop(paddingTop);
        }

        // padding-bottom
        Float paddingBottom = tableCellProperties.getPaddingBottom();
        if (paddingBottom != null) {
            super.setPaddingBottom(paddingBottom);
        }

        // padding-left
        Float paddingLeft = tableCellProperties.getPaddingLeft();
        if (paddingLeft != null) {
            super.setPaddingLeft(paddingLeft);
        }

        // padding-right
        Float paddingRight = tableCellProperties.getPaddingRight();
        if (paddingRight != null) {
            super.setPaddingRight(paddingRight);
        }

        // vertical-alignment
        int verticalAlignment = tableCellProperties.getVerticalAlignment();
        if (verticalAlignment != Element.ALIGN_UNDEFINED) {
            super.setVerticalAlignment(verticalAlignment);
        }
    }
}

From source file:fr.opensagres.odfdom.converter.pdf.internal.StyleEngineForIText.java

License:Open Source License

@Override
public void visit(StyleParagraphPropertiesElement ele) {

    StyleParagraphProperties paragraphProperties = currentStyle.getParagraphProperties();
    if (paragraphProperties == null) {
        paragraphProperties = new StyleParagraphProperties();
        currentStyle.setParagraphProperties(paragraphProperties);
    }//ww  w  .  j  a  v  a2s .  c  o m

    // background-color
    String backgroundColor = ele.getFoBackgroundColorAttribute();
    if (StringUtils.isNotEmpty(backgroundColor)) {
        paragraphProperties.setBackgroundColor(ColorRegistry.getInstance().getColor(backgroundColor));
    }

    // border
    String border = ele.getFoBorderAttribute();
    if (StringUtils.isNotEmpty(border)) {
        paragraphProperties.setBorder(new StyleBorder(border, BorderType.ALL));
    }
    // border-bottom
    String borderBottom = ele.getFoBorderBottomAttribute();
    if (StringUtils.isNotEmpty(borderBottom)) {
        paragraphProperties.setBorderBottom(new StyleBorder(borderBottom, BorderType.BOTTOM));
    }

    // border-left
    String borderLeft = ele.getFoBorderLeftAttribute();
    if (StringUtils.isNotEmpty(borderLeft)) {
        paragraphProperties.setBorderLeft(new StyleBorder(borderLeft, BorderType.LEFT));
    }

    // border-bottom
    String borderRight = ele.getFoBorderRightAttribute();
    if (StringUtils.isNotEmpty(borderRight)) {
        paragraphProperties.setBorderRight(new StyleBorder(borderRight, BorderType.RIGHT));
    }

    // border-top
    String borderTop = ele.getFoBorderTopAttribute();
    if (StringUtils.isNotEmpty(borderTop)) {
        paragraphProperties.setBorderTop(new StyleBorder(borderTop, BorderType.TOP));
    }

    // join-border
    Boolean joinBorder = ele.getStyleJoinBorderAttribute();
    if (joinBorder != null) {
        paragraphProperties.setJoinBorder(joinBorder);
    }

    // line-height
    String lineHeight = ele.getFoLineHeightAttribute();
    if (StringUtils.isNotEmpty(lineHeight)) {
        paragraphProperties.setLineHeight(new StyleLineHeight(ODFUtils.getDimensionAsPoint(lineHeight),
                ODFUtils.hasPercentUnit(lineHeight)));
    }

    // margin
    String margin = ele.getFoMarginAttribute();
    if (StringUtils.isNotEmpty(margin)) {
        paragraphProperties.setMargin(ODFUtils.getDimensionAsPoint(margin));
    }

    // margin-bottom
    String marginBottom = ele.getFoMarginBottomAttribute();
    if (StringUtils.isNotEmpty(marginBottom)) {
        paragraphProperties.setMarginBottom(ODFUtils.getDimensionAsPoint(marginBottom));
    }

    // margin-left
    String marginLeft = ele.getFoMarginLeftAttribute();
    if (StringUtils.isNotEmpty(marginLeft)) {
        paragraphProperties.setMarginLeft(ODFUtils.getDimensionAsPoint(marginLeft));
    }

    // margin-right
    String marginRight = ele.getFoMarginRightAttribute();
    if (StringUtils.isNotEmpty(marginRight)) {
        paragraphProperties.setMarginRight(ODFUtils.getDimensionAsPoint(marginRight));
    }

    // margin-top
    String marginTop = ele.getFoMarginTopAttribute();
    if (StringUtils.isNotEmpty(marginTop)) {
        paragraphProperties.setMarginTop(ODFUtils.getDimensionAsPoint(marginTop));
    }

    // padding
    String padding = ele.getFoPaddingAttribute();
    if (StringUtils.isNotEmpty(padding)) {
        paragraphProperties.setPadding(ODFUtils.getDimensionAsPoint(padding));
    }

    // padding-bottom
    String paddingBottom = ele.getFoPaddingBottomAttribute();
    if (StringUtils.isNotEmpty(paddingBottom)) {
        paragraphProperties.setPaddingBottom(ODFUtils.getDimensionAsPoint(paddingBottom));
    }

    // padding-left
    String paddingLeft = ele.getFoPaddingLeftAttribute();
    if (StringUtils.isNotEmpty(paddingLeft)) {
        paragraphProperties.setPaddingLeft(ODFUtils.getDimensionAsPoint(paddingLeft));
    }

    // padding-right
    String paddingRight = ele.getFoPaddingRightAttribute();
    if (StringUtils.isNotEmpty(paddingRight)) {
        paragraphProperties.setPaddingRight(ODFUtils.getDimensionAsPoint(paddingRight));
    }

    // padding-top
    String paddingTop = ele.getFoPaddingTopAttribute();
    if (StringUtils.isNotEmpty(paddingTop)) {
        paragraphProperties.setPaddingTop(ODFUtils.getDimensionAsPoint(paddingTop));
    }

    // text-align
    String textAlign = ele.getFoTextAlignAttribute();
    if (StringUtils.isNotEmpty(textAlign)) {
        int alignment = Element.ALIGN_UNDEFINED;
        if (FoTextAlignAttribute.Value.START.toString().equals(textAlign)) {
            alignment = Element.ALIGN_LEFT;
        } else if (FoTextAlignAttribute.Value.END.toString().equals(textAlign)) {
            alignment = Element.ALIGN_RIGHT;
        } else if (FoTextAlignAttribute.Value.LEFT.toString().equals(textAlign)) {
            alignment = Element.ALIGN_LEFT;
        } else if (FoTextAlignAttribute.Value.RIGHT.toString().equals(textAlign)) {
            alignment = Element.ALIGN_RIGHT;
        } else if (FoTextAlignAttribute.Value.CENTER.toString().equals(textAlign)) {
            alignment = Element.ALIGN_CENTER;
        } else if (FoTextAlignAttribute.Value.JUSTIFY.toString().equals(textAlign)) {
            alignment = Element.ALIGN_JUSTIFIED;
        }
        paragraphProperties.setAlignment(alignment);
    }

    // auto-text-indent
    Boolean autoTextIndent = ele.getStyleAutoTextIndentAttribute();
    if (autoTextIndent != null) {
        paragraphProperties.setAutoTextIndent(autoTextIndent);
    }

    // text-indent
    String textIndent = ele.getFoTextIndentAttribute();
    if (StringUtils.isNotEmpty(textIndent)) {
        paragraphProperties.setTextIndent(ODFUtils.getDimensionAsPoint(textIndent));
    }

    // keep-together
    String keepTogether = ele.getFoKeepTogetherAttribute();
    if (StringUtils.isNotEmpty(keepTogether)) {
        if (FoKeepTogetherAttribute.Value.ALWAYS.toString().equals(keepTogether)) {
            paragraphProperties.setKeepTogether(Boolean.TRUE);
        } else {
            paragraphProperties.setKeepTogether(Boolean.FALSE);
        }
    }

    // fo:break-before
    String breakBefore = ele.getFoBreakBeforeAttribute();
    if (StringUtils.isNotEmpty(breakBefore)) {
        if (FoBreakBeforeAttribute.Value.PAGE.toString().equals(breakBefore)) {
            paragraphProperties.setBreakBefore(StyleBreak.createWithPageBreak());
        } else if (FoBreakBeforeAttribute.Value.COLUMN.toString().equals(breakBefore)) {
            paragraphProperties.setBreakBefore(StyleBreak.createWithColumnBreak());
        } else {
            paragraphProperties.setBreakBefore(StyleBreak.createWithNoBreak());
        }
    }

    super.visit(ele);
}

From source file:fr.opensagres.odfdom.converter.pdf.internal.styles.StyleParagraphProperties.java

License:Open Source License

public void merge(StyleParagraphProperties paragraphProperties) {
    if (paragraphProperties.getAlignment() != Element.ALIGN_UNDEFINED) {
        alignment = paragraphProperties.getAlignment();
    }//from  w  ww  .  j  a v  a 2 s  . co  m
    if (paragraphProperties.getAutoTextIndent() != null) {
        autoTextIndent = paragraphProperties.getAutoTextIndent();
    }
    if (paragraphProperties.getBackgroundColor() != null) {
        backgroundColor = paragraphProperties.getBackgroundColor();
    }
    if (paragraphProperties.getBorder() != null) {
        border = paragraphProperties.getBorder();
    }
    if (paragraphProperties.getBorderBottom() != null) {
        borderBottom = paragraphProperties.getBorderBottom();
    }
    if (paragraphProperties.getBorderLeft() != null) {
        borderLeft = paragraphProperties.getBorderLeft();
    }
    if (paragraphProperties.getBorderRight() != null) {
        borderRight = paragraphProperties.getBorderRight();
    }
    if (paragraphProperties.getBorderTop() != null) {
        borderTop = paragraphProperties.getBorderTop();
    }
    if (paragraphProperties.getBreakBefore() != null) {
        breakBefore = paragraphProperties.getBreakBefore();
    }
    if (paragraphProperties.getJoinBorder() != null) {
        joinBorder = paragraphProperties.getJoinBorder();
    }
    if (paragraphProperties.getKeepTogether() != null) {
        keepTogether = paragraphProperties.getKeepTogether();
    }
    if (paragraphProperties.getLineHeight() != null) {
        lineHeight = paragraphProperties.getLineHeight();
    }
    if (paragraphProperties.getMargin() != null) {
        margin = paragraphProperties.getMargin();
    }
    if (paragraphProperties.getMarginBottom() != null) {
        marginBottom = paragraphProperties.getMarginBottom();
    }
    if (paragraphProperties.getMarginLeft() != null) {
        marginLeft = paragraphProperties.getMarginLeft();
    }
    if (paragraphProperties.getMarginRight() != null) {
        marginRight = paragraphProperties.getMarginRight();
    }
    if (paragraphProperties.getMarginTop() != null) {
        marginTop = paragraphProperties.getMarginTop();
    }
    if (paragraphProperties.getPadding() != null) {
        padding = paragraphProperties.getPadding();
    }
    if (paragraphProperties.getPaddingBottom() != null) {
        paddingBottom = paragraphProperties.getPaddingBottom();
    }
    if (paragraphProperties.getPaddingLeft() != null) {
        paddingLeft = paragraphProperties.getPaddingLeft();
    }
    if (paragraphProperties.getPaddingRight() != null) {
        paddingRight = paragraphProperties.getPaddingRight();
    }
    if (paragraphProperties.getPaddingTop() != null) {
        paddingTop = paragraphProperties.getPaddingTop();
    }
    if (paragraphProperties.getTextIndent() != null) {
        textIndent = paragraphProperties.getTextIndent();
    }
}

From source file:fr.opensagres.odfdom.converter.pdf.internal.styles.StyleTableCellProperties.java

License:Open Source License

public void merge(StyleTableCellProperties tableCellProperties) {
    if (tableCellProperties.getBackgroundColor() != null) {
        backgroundColor = tableCellProperties.getBackgroundColor();
    }// w  w  w .  java 2s. c  o  m
    if (tableCellProperties.getBorder() != null) {
        border = tableCellProperties.getBorder();
    }
    if (tableCellProperties.getBorderBottom() != null) {
        borderBottom = tableCellProperties.getBorderBottom();
    }
    if (tableCellProperties.getBorderLeft() != null) {
        borderLeft = tableCellProperties.getBorderLeft();
    }
    if (tableCellProperties.getBorderRight() != null) {
        borderRight = tableCellProperties.getBorderRight();
    }
    if (tableCellProperties.getBorderTop() != null) {
        borderTop = tableCellProperties.getBorderTop();
    }
    if (tableCellProperties.getPadding() != null) {
        padding = tableCellProperties.getPadding();
    }
    if (tableCellProperties.getPaddingBottom() != null) {
        paddingBottom = tableCellProperties.getPaddingBottom();
    }
    if (tableCellProperties.getPaddingLeft() != null) {
        paddingLeft = tableCellProperties.getPaddingLeft();
    }
    if (tableCellProperties.getPaddingRight() != null) {
        paddingRight = tableCellProperties.getPaddingRight();
    }
    if (tableCellProperties.getPaddingTop() != null) {
        paddingTop = tableCellProperties.getPaddingTop();
    }
    if (tableCellProperties.getVerticalAlignment() != Element.ALIGN_UNDEFINED) {
        verticalAlignment = tableCellProperties.getVerticalAlignment();
    }
}

From source file:fr.opensagres.odfdom.converter.pdf.internal.styles.StyleTableProperties.java

License:Open Source License

public void merge(StyleTableProperties tableProperties) {
    if (tableProperties.getAlignment() != Element.ALIGN_UNDEFINED) {
        alignment = tableProperties.getAlignment();
    }/*from  w  w w  .j  a v a2s. com*/
    if (tableProperties.getBackgroundColor() != null) {
        backgroundColor = tableProperties.getBackgroundColor();
    }
    if (tableProperties.getMargin() != null) {
        margin = tableProperties.getMargin();
    }
    if (tableProperties.getMarginBottom() != null) {
        marginBottom = tableProperties.getMarginBottom();
    }
    if (tableProperties.getMarginLeft() != null) {
        marginLeft = tableProperties.getMarginLeft();
    }
    if (tableProperties.getMarginRight() != null) {
        marginRight = tableProperties.getMarginRight();
    }
    if (tableProperties.getMarginTop() != null) {
        marginTop = tableProperties.getMarginTop();
    }
    if (tableProperties.getMayBreakBetweenRows() != null) {
        mayBreakBetweenRows = tableProperties.getMayBreakBetweenRows();
    }
    if (tableProperties.getWidth() != null) {
        width = tableProperties.getWidth();
    }
}

From source file:org.apache.poi.xwpf.converter.internal.itext.stylable.StylableListItem.java

License:Open Source License

public void applyStyles(Object ele, Style style) {
    this.lastStyleApplied = style;

    // Font//from   w w w. j  a  v  a2  s.c o m
    Font font = null;// style.getFont();
    if (font != null) {
        super.setFont(font);
    }
    // Alignment
    int alignment = 0;// style.getAlignment();
    if (alignment != Element.ALIGN_UNDEFINED) {
        super.setAlignment(alignment);
    }

}

From source file:org.apache.poi.xwpf.converter.internal.itext.stylable.StylableParagraph.java

License:Open Source License

public void applyStyles(XWPFParagraph p, Style style) {

    if (style != null) {
        // first process values from "style"
        // will be overridden by in-line values if available...
        StyleParagraphProperties paragraphProperties = style.getParagraphProperties();

        if (paragraphProperties != null) {
            FontInfos fontInfos = paragraphProperties.getFontInfos();
            if (fontInfos != null) {
                Font font = XWPFFontRegistry.getRegistry().getFont(fontInfos.getFontFamily(),
                        fontInfos.getFontEncoding(), fontInfos.getFontSize(), fontInfos.getFontStyle(),
                        fontInfos.getFontColor());
                setFont(font);/*  w  w  w.  j a  v a 2 s .  co m*/
            }
            // Alignment
            int alignment = paragraphProperties.getAlignment();
            if (alignment != Element.ALIGN_UNDEFINED) {
                setAlignment(alignment);
            }

            Float lineHeight = paragraphProperties.getLineHeight();
            if (lineHeight != null) {
                // super.getPdfPCell().setMinimumHeight(lineHeight);
                // FIXME : Is it correct???
                setLeading(lineHeight * super.getTotalLeading());
            }
            // System.err.println("IndentationRight "+paragraphProperties.getIndentationRight());
            setIndentationRight(paragraphProperties.getIndentationRight());
            setIndentationLeft(paragraphProperties.getIndentationLeft());
            setFirstLineIndent(paragraphProperties.getIndentationFirstLine());
            // StyleBorder borderBottom= paragraphProperties.getBorderBottom();

        }

    }

    ParagraphAlignment paragraphAlignment = p.getAlignment();

    // text-align

    if (paragraphAlignment != null) {
        int alignment = Element.ALIGN_UNDEFINED;
        switch (paragraphAlignment) {
        case LEFT:
            alignment = Element.ALIGN_LEFT;
            break;
        case RIGHT:
            alignment = Element.ALIGN_RIGHT;
            break;
        case CENTER:
            alignment = Element.ALIGN_CENTER;
            break;
        case BOTH:
            alignment = Element.ALIGN_JUSTIFIED;
            break;
        default:
            break;
        }

        setAlignment(alignment);
    }

    int indentationLeft = p.getIndentationLeft();
    if (indentationLeft > 0) {
        setIndentationLeft(indentationLeft);
    }

    // text-indent
    int indentationFirstLine = p.getIndentationFirstLine();
    if (indentationFirstLine > 0) {
        setFirstLineIndent(indentationFirstLine);
    }

    int indentationRight = p.getIndentationRight();

    if (indentationRight > 0) {
        setIndentationRight(indentationRight);
    }
    // verticalAlignment DOES not exists in StyleParagraphProperties iText
    // TextAlignment textAlignment = p.getVerticalAlignment();

    int left = p.getIndentationLeft();
    int right = p.getIndentationRight();

    if (right > 0) {
        setIndentationRight(dxa2points(right));
    }

    if (left > 0) {
        setIndentationLeft(dxa2points(left));
    }

    int firstLineIndent = p.getIndentationFirstLine();
    if (firstLineIndent > 0) {
        setFirstLineIndent(dxa2points(firstLineIndent));
    }

    int spacingBefore = p.getSpacingBefore();
    if (spacingBefore > 0) {
        setSpacingBefore(dxa2points(spacingBefore));
    }
    if (p.getSpacingAfter() >= 0) {
        setSpacingAfter(dxa2points(p.getSpacingAfter()));

    } else {
        // XXX Seems to be a default :
        setSpacingAfter(10f);
    }

    if (p.getCTP().getPPr() != null) {
        if (p.getCTP().getPPr().getSpacing() != null) {

            if (p.getCTP().getPPr().getSpacing().getLine() != null) {

                // XXX PLQ : why 240 ???
                float leading = (p.getCTP().getPPr().getSpacing().getLine().floatValue() / 240);
                setMultipliedLeading(leading);
            }

        }
    }

    ParagraphAlignment alignment = p.getAlignment();
    switch (alignment) {
    case LEFT:
        setAlignment(Element.ALIGN_LEFT);
        break;
    case RIGHT:
        setAlignment(Element.ALIGN_RIGHT);
        break;

    case CENTER:
        setAlignment(Element.ALIGN_CENTER);
        break;

    case BOTH:
        setAlignment(Element.ALIGN_JUSTIFIED);
        break;

    default:
        break;
    }

}