/** * Constructor for embedding. */ public PDPageTree() { root = new COSDictionary(); root.setItem(COSName.TYPE, COSName.PAGES); root.setItem(COSName.KIDS, new COSArray()); root.setItem(COSName.COUNT, COSInteger.ZERO); document = null; }
/** * This will set start and end coordinates of the line (or leader line if LL entry is set). * * @param line array of 4 floats [x1, y1, x2, y2] line start and end points in default user space. */ public final void setLine(float[] line) { COSArray newLine = new COSArray(); newLine.setFloatArray(line); annot.setItem(COSName.L, newLine); }
/** * 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 is a convenience method that will get the dictionary object that is expected to be a * string. Null is returned if the entry does not exist in the dictionary. * * @param key The key to the item in the dictionary. * @return The name converted to a string. */ public String getString(String key) { return getString(COSName.getPDFName(key)); }
/** * This is a convenience method that will convert the value to a COSString object. If it is null then the object * will be removed. * * @param embedded The embedded dictionary to set the item in. * @param key The key to the object, * @param value The string value for the name. */ public void setEmbeddedString(String embedded, String key, String value) { setEmbeddedString(embedded, COSName.getPDFName(key), value); }
/** * This is a convenience method that will convert the value to a COSInteger object. * * @param key The key to the object, * @param value The int value for the name. */ public void setLong(String key, long value) { setLong(COSName.getPDFName(key), value); }
/** * This is a convenience method that will get the dictionary object that is expected to be a name and convert it to * a string. Null is returned if the entry does not exist in the dictionary or if the date was invalid. * * @param key The key to the item in the dictionary. * @return The name converted to a date. */ public Calendar getDate(String key) { return getDate(COSName.getPDFName(key)); }
/** * This will set an item in the dictionary. * * @param key The key to the dictionary object. * @param value The value to the dictionary object. */ public void setBoolean(COSName key, boolean value) { setItem(key, COSBoolean.getBoolean(value)); }