Search in sources :

Example 1 with AWTColor

use of com.tom_roush.harmony.awt.AWTColor in project PdfBox-Android by TomRoush.

the class FDFAnnotation method getColor.

/**
 * Get the annotation color.
 *
 * @return The annotation color, or null if there is none.
 */
public AWTColor getColor() {
    AWTColor retval = null;
    COSArray array = (COSArray) annot.getDictionaryObject(COSName.C);
    if (array != null) {
        float[] rgb = array.toFloatArray();
        if (rgb.length >= 3) {
            retval = new AWTColor(rgb[0], rgb[1], rgb[2]);
        }
    }
    return retval;
}
Also used : AWTColor(com.tom_roush.harmony.awt.AWTColor) COSArray(com.tom_roush.pdfbox.cos.COSArray)

Example 2 with AWTColor

use of com.tom_roush.harmony.awt.AWTColor in project PdfBox-Android by TomRoush.

the class FDFAnnotationPolyline method getInteriorColor.

/**
 * This will retrieve the interior color of the line endings defined in the LE entry.
 *
 * @return object representing the color.
 */
public AWTColor getInteriorColor() {
    AWTColor retval = null;
    COSArray array = (COSArray) annot.getDictionaryObject(COSName.IC);
    if (array != null) {
        float[] rgb = array.toFloatArray();
        if (rgb.length >= 3) {
            retval = new AWTColor(rgb[0], rgb[1], rgb[2]);
        }
    }
    return retval;
}
Also used : AWTColor(com.tom_roush.harmony.awt.AWTColor) COSArray(com.tom_roush.pdfbox.cos.COSArray)

Example 3 with AWTColor

use of com.tom_roush.harmony.awt.AWTColor in project PdfBox-Android by TomRoush.

the class FDFAnnotationSquare method getInteriorColor.

/**
 * This will retrieve the interior color of the drawn area.
 *
 * @return object representing the color.
 */
public AWTColor getInteriorColor() {
    AWTColor retval = null;
    COSArray array = (COSArray) annot.getDictionaryObject(COSName.IC);
    if (array != null) {
        float[] rgb = array.toFloatArray();
        if (rgb.length >= 3) {
            retval = new AWTColor(rgb[0], rgb[1], rgb[2]);
        }
    }
    return retval;
}
Also used : AWTColor(com.tom_roush.harmony.awt.AWTColor) COSArray(com.tom_roush.pdfbox.cos.COSArray)

Example 4 with AWTColor

use of com.tom_roush.harmony.awt.AWTColor in project PdfBox-Android by TomRoush.

the class FDFAnnotationPolyline method initStyles.

private void initStyles(Element element) {
    String startStyle = element.getAttribute("head");
    if (startStyle != null && !startStyle.isEmpty()) {
        setStartPointEndingStyle(startStyle);
    }
    String endStyle = element.getAttribute("tail");
    if (endStyle != null && !endStyle.isEmpty()) {
        setEndPointEndingStyle(endStyle);
    }
    String color = element.getAttribute("interior-color");
    if (color != null && color.length() == 7 && color.charAt(0) == '#') {
        int colorValue = Integer.parseInt(color.substring(1, 7), 16);
        setInteriorColor(new AWTColor(colorValue));
    }
}
Also used : AWTColor(com.tom_roush.harmony.awt.AWTColor)

Example 5 with AWTColor

use of com.tom_roush.harmony.awt.AWTColor in project PdfBox-Android by TomRoush.

the class FDFAnnotationLine method getInteriorColor.

/**
 * This will retrieve the interior color of the line endings defined in the LE entry.
 *
 * @return object representing the color.
 */
public AWTColor getInteriorColor() {
    AWTColor retval = null;
    COSArray array = (COSArray) annot.getDictionaryObject(COSName.IC);
    if (array != null) {
        float[] rgb = array.toFloatArray();
        if (rgb.length >= 3) {
            retval = new AWTColor(rgb[0], rgb[1], rgb[2]);
        }
    }
    return retval;
}
Also used : AWTColor(com.tom_roush.harmony.awt.AWTColor) COSArray(com.tom_roush.pdfbox.cos.COSArray)

Aggregations

AWTColor (com.tom_roush.harmony.awt.AWTColor)7 COSArray (com.tom_roush.pdfbox.cos.COSArray)6