/** * Constructor. */ public PDAnnotationPolygon() { getCOSObject().setName(COSName.SUBTYPE, SUB_TYPE); }
/** * This will set the border effect dictionary, specifying effects to be applied when drawing the * line. This is supported by PDF 1.5 and higher. * * @param be The border effect dictionary to set. * */ public void setBorderEffect(PDBorderEffectDictionary be) { getCOSObject().setItem(COSName.BE, be); }
/** * This will set interior color. * * @param ic color. */ public void setInteriorColor(PDColor ic) { getCOSObject().setItem(COSName.IC, ic.toCOSArray()); }
/** * This will retrieve the numbers that shall represent the alternating horizontal and vertical * coordinates. * * @return An array of floats representing the alternating horizontal and vertical coordinates. */ public float[] getVertices() { COSBase base = getCOSObject().getDictionaryObject(COSName.VERTICES); if (base instanceof COSArray) { return ((COSArray) base).toFloatArray(); } return null; }
/** * This will retrieve the border effect dictionary, specifying effects to be applied used in * drawing the line. * * @return The border effect dictionary */ public PDBorderEffectDictionary getBorderEffect() { COSDictionary be = (COSDictionary) getCOSObject().getDictionaryObject(COSName.BE); if (be != null) { return new PDBorderEffectDictionary(be); } else { return null; } }
/** * This will set the numbers that shall represent the alternating horizontal and vertical * coordinates. * * @param points an array with the numbers that shall represent the alternating horizontal and * vertical coordinates. */ public void setVertices(float[] points) { COSArray ar = new COSArray(); ar.setFloatArray(points); getCOSObject().setItem(COSName.VERTICES, ar); }
/** * PDF 2.0: This will retrieve the arrays that shall represent the alternating horizontal * and vertical coordinates for path building. * * @return An array of float arrays, each supplying the operands for a path building operator * (m, l or c). The first array should have 2 elements, the others should have 2 or 6 elements. */ public float[][] getPath() { COSBase base = getCOSObject().getDictionaryObject(COSName.PATH); if (base instanceof COSArray) { COSArray array = (COSArray) base; float[][] pathArray = new float[array.size()][]; for (int i = 0; i < array.size(); ++i) { COSBase base2 = array.getObject(i); if (base2 instanceof COSArray) { pathArray[i] = ((COSArray) array.getObject(i)).toFloatArray(); } else { pathArray[i] = new float[0]; } } return pathArray; } return null; }