Example usage for com.itextpdf.text Element ALIGN_UNDEFINED

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

Introduction

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

Prototype

int ALIGN_UNDEFINED

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

Click Source Link

Document

A possible value for paragraph alignment.

Usage

From source file:com.cyberninjas.pdf.PdfEditor.java

License:Open Source License

/**
 * Converts an {@link Alignment} to a value recognized by iText.
 *
 * @param align the alignment type./*  w ww .java 2 s. c  o m*/
 * @return the horizontal alignment recognized by iText.
 */
private int convertHorizontalAlignment(final Alignment align) {
    switch (align) {
    case LEFT:
        return Element.ALIGN_LEFT;

    case RIGHT:
        return Element.ALIGN_RIGHT;

    case CENTER:
        return Element.ALIGN_CENTER;

    default:
        return Element.ALIGN_UNDEFINED;
    }
}

From source file:com.masscustsoft.service.ToPdf.java

License:Open Source License

private int getAlignment(Map it, String fld) {
    String alignment = MapUtil.getStr(it, fld);
    int align = Element.ALIGN_UNDEFINED;
    if ("right".equalsIgnoreCase(alignment))
        align = Element.ALIGN_RIGHT;
    if ("left".equalsIgnoreCase(alignment))
        align = Element.ALIGN_LEFT;
    if ("center".equalsIgnoreCase(alignment))
        align = Element.ALIGN_CENTER;
    return align;
}

From source file:com.masscustsoft.service.ToPdf.java

License:Open Source License

private int getVAlign(Map it, String fld) {
    String alignment = MapUtil.getStr(it, fld);
    int align = Element.ALIGN_UNDEFINED;
    if ("bottom".equalsIgnoreCase(alignment))
        align = Element.ALIGN_BOTTOM;
    if ("top".equalsIgnoreCase(alignment))
        align = Element.ALIGN_TOP;
    if ("middle".equalsIgnoreCase(alignment))
        align = Element.ALIGN_MIDDLE;
    return align;
}

From source file:nz.ac.waikato.cms.doc.SimplePDFOverlay.java

License:Open Source License

/**
 * Parses the alignment string./*from ww  w. j a v a 2  s .  c om*/
 *
 * @param str      the alignment string
 * @return      the alignment, see {@link Element}
 */
protected int parseAlignment(String str) {
    switch (str) {
    case "UNDEFINED":
        return Element.ALIGN_UNDEFINED;
    case "LEFT":
        return Element.ALIGN_LEFT;
    case "CENTER":
        return Element.ALIGN_CENTER;
    case "RIGHT":
        return Element.ALIGN_RIGHT;
    case "JUSTIFIED":
        return Element.ALIGN_JUSTIFIED;
    default:
        m_Logger.warning("Unhandled alignment, falling back to LEFT: " + str);
        return Element.ALIGN_LEFT;
    }
}