/** * Get the lowest value for a key in the number map. * * @return The lowest value for a key in the map. */ public Integer getLowerLimit() { Integer retval = null; COSArray arr = (COSArray)node.getDictionaryObject( COSName.LIMITS ); if( arr != null && arr.get(0) != null ) { retval = arr.getInt( 0 ); } return retval; }
/** * returns the COSString contained in the Recipients field at position i. * * @param i the position in the Recipients field array. * * @return a COSString object containing information about the recipient number i. */ public COSString getRecipientStringAt(int i) { COSArray array = (COSArray) dictionary.getItem(COSName.RECIPIENTS); return (COSString)array.get(i); }
/** * This will get the lower left x coordinate. * * @return The lower left x. */ public float getLowerLeftX() { return ((COSNumber)rectArray.get(0)).floatValue(); }
/** * Get the highest value for a key in the number map. * * @return The highest value for a key in the map. */ public Integer getUpperLimit() { Integer retval = null; COSArray arr = (COSArray)node.getDictionaryObject( COSName.LIMITS ); if( arr != null && arr.get(0) != null ) { retval = arr.getInt( 1 ); } return retval; }
/** * This will get the upper right y coordinate. * * @return The upper right y. */ public float getUpperRightY() { return ((COSNumber)rectArray.get(3)).floatValue(); }
/** * This will get the lower left y coordinate. * * @return The lower left y. */ public float getLowerLeftY() { return ((COSNumber)rectArray.get(1)).floatValue(); }
/** * Returns the b value of the tristimulus. * @return the B value */ public float getB() { return ((COSNumber)values.get(2)).floatValue(); }
/** * Returns the x value of the tristimulus. * @return the X value */ public float getX() { return ((COSNumber)values.get(0)).floatValue(); }
/** * Returns the y value of the tristimulus. * @return the Y value */ public float getY() { return ((COSNumber)values.get(1)).floatValue(); }
/** * Returns the z value of the tristimulus. * @return the Z value */ public float getZ() { return ((COSNumber)values.get(2)).floatValue(); }
/** * This will get the upper right x coordinate. * * @return The upper right x . */ public float getUpperRightX() { return ((COSNumber)rectArray.get(2)).floatValue(); }
/** * Returns the r value of the tristimulus. * @return the R value. */ public float getR() { return ((COSNumber)values.get(0)).floatValue(); }
/** * Returns the g value of the tristimulus. * @return the g value */ public float getG() { return ((COSNumber)values.get(1)).floatValue(); }
/** * This will get the size of the font. * * @return The size of the font. */ public float getFontSize() { COSNumber size = (COSNumber)fontSetting.get( 1 ); return size.floatValue(); }
private boolean validateExplicitDestination(COSArray ar) { if (!(ar.get(0) instanceof COSNumber)) { // "its first element shall be a page number" context.addValidationError(new ValidationError(ERROR_ACTION_INVALID_TYPE, "First element in /D array entry of GoToRemoteAction must be a page number, but is " + ar.get(0))); return false; } return true; }
/** * Return contents of COSArray as a Java List. * * @return the COSArray as List */ public List<? extends COSBase> toList() { List<COSBase> retList = new ArrayList<>(size()); for (int i = 0; i < size(); i++) { retList.add(get(i)); } return retList; } }
private boolean isSpecialColorSpace(Object selectedNode) { selectedNode = getUnderneathObject(selectedNode); if (selectedNode instanceof COSArray && ((COSArray) selectedNode).size() > 0) { COSBase arrayEntry = ((COSArray)selectedNode).get(0); if (arrayEntry instanceof COSName) { COSName name = (COSName) arrayEntry; return SPECIALCOLORSPACES.contains(name); } } return false; }
private boolean isOtherColorSpace(Object selectedNode) { selectedNode = getUnderneathObject(selectedNode); if (selectedNode instanceof COSArray && ((COSArray) selectedNode).size() > 0) { COSBase arrayEntry = ((COSArray)selectedNode).get(0); if (arrayEntry instanceof COSName) { COSName name = (COSName) arrayEntry; return OTHERCOLORSPACES.contains(name); } } return false; }
/** * This will decrypt an array. * * @param array The array to decrypt. * @param objNum The object number. * @param genNum The object generation number. * * @throws IOException If there is an error accessing the data. */ private void decryptArray(COSArray array, long objNum, long genNum) throws IOException { for (int i = 0; i < array.size(); i++) { decrypt(array.get(i), objNum, genNum); } }
/** * Creates a new indexed color space from the given PDF array. * @param indexedArray the array containing the indexed parameters * @param resources the resources, can be null. Allows to use its cache for the colorspace. * @throws java.io.IOException */ public PDIndexed(COSArray indexedArray, PDResources resources) throws IOException { array = indexedArray; // don't call getObject(1), we want to pass a reference if possible // to profit from caching (PDFBOX-4149) baseColorSpace = PDColorSpace.create(array.get(1), resources); readColorTable(); initRgbColorTable(); }