/** * @return the value for this direction */ public COSBase getCOSBase() { return COSInteger.get(degrees); } }
/** * This will set an object at a specific index. * * @param index zero based index into array. * @param intVal The object to set. */ public void set( int index, int intVal ) { objects.set( index, COSInteger.get(intVal) ); }
/** * 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(COSName key, long value) { COSInteger intVal = COSInteger.get(value); setItem(key, intVal); }
/** * Set the value in the array as an integer. * * @param index The index into the array. * @param value The value to set. */ public void setInt( int index, int value ) { set( index, COSInteger.get( 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 setInt(COSName key, int value) { setItem(key, COSInteger.get(value)); }
/** * This will get the field flags that are associated with this field. The Ff entry in the FDF field dictionary. * * @param ff The new value for the field flags. */ public void setFieldFlags(Integer ff) { COSInteger value = null; if (ff != null) { value = COSInteger.get(ff); } field.setItem(COSName.FF, value); }
/** * This will get the field flags that are associated with this field. The ClrFf entry in the FDF field dictionary. * * @param ff The new value for the "clear field flags". */ public void setClearFieldFlags(Integer ff) { COSInteger value = null; if (ff != null) { value = COSInteger.get(ff); } field.setItem(COSName.CLR_FF, value); }
/** * This will get the field flags that are associated with this field. The SetFf entry in the FDF field dictionary. * * @param ff The new value for the "set field flags". */ public void setSetFieldFlags(Integer ff) { COSInteger value = null; if (ff != null) { value = COSInteger.get(ff); } field.setItem(COSName.SET_FF, value); }
/** * This will get the field flags that are associated with this field. The ClrF entry in the FDF field dictionary. * * @param ff The new value for the "clear widget field flags". */ public void setClearWidgetFieldFlags(Integer ff) { COSInteger value = null; if (ff != null) { value = COSInteger.get(ff); } field.setItem(COSName.CLR_F, value); }
/** * This will get the widget field flags that are associated with this field. The F entry in the FDF field * dictionary. * * @param f The new value for the field flags. */ public void setWidgetFieldFlags(Integer f) { COSInteger value = null; if (f != null) { value = COSInteger.get(f); } field.setItem(COSName.F, value); }
/** * This will get the widget field flags that are associated with this field. The SetF entry in the FDF field * dictionary. * * @param ff The new value for the "set widget field flags". */ public void setSetWidgetFieldFlags(Integer ff) { COSInteger value = null; if (ff != null) { value = COSInteger.get(ff); } field.setItem(COSName.SET_F, value); }
/** * Appends a marked-content sequence kid. * * @param markedContent the marked-content sequence */ public void appendKid(PDMarkedContent markedContent) { if (markedContent == null) { return; } this.appendKid(COSInteger.get(markedContent.getMCID())); }
@Override public COSBase getCOSObject() { COSArray cos = new COSArray(); cos.add(COSArrayList.converterToCOSArray(Arrays.asList(array))); cos.add(COSInteger.get(phase)); return cos; }
/** * {@inheritDoc} */ @Override public COSBase getCOSObject() { COSDictionary dict = new COSDictionary(); COSArray arr = new COSArray(); for (Entry<Integer, PDPageLabelRange> i : labels.entrySet()) { arr.add(COSInteger.get(i.getKey())); arr.add(i.getValue()); } dict.setItem(COSName.NUMS, arr); return dict; }
/** * Sets the byte range. * * @param range the byte range to be used */ public void setByteRange(int[] range) { if (range.length!=4) { return; } COSArray ary = new COSArray(); for ( int i : range ) { ary.add(COSInteger.get(i)); } dictionary.setItem(COSName.BYTERANGE, ary); }
private boolean buildVerticalHeader(COSDictionary cidFont) throws IOException { VerticalHeaderTable vhea = ttf.getVerticalHeader(); if (vhea == null) { LOG.warn("Font to be subset is set to vertical, but has no 'vhea' table"); return false; } float scaling = 1000f / ttf.getHeader().getUnitsPerEm(); long v = Math.round(vhea.getAscender() * scaling); long w1 = Math.round(-vhea.getAdvanceHeightMax() * scaling); if (v != 880 || w1 != -1000) { COSArray cosDw2 = new COSArray(); cosDw2.add(COSInteger.get(v)); cosDw2.add(COSInteger.get(w1)); cidFont.setItem(COSName.DW2, cosDw2); } return true; }
/** * Creates a new Indexed color space. * Default DeviceRGB, hival 255. */ public PDIndexed() { array = new COSArray(); array.add(COSName.INDEXED); array.add(COSName.DEVICERGB); array.add(COSInteger.get(255)); array.add(org.apache.pdfbox.cos.COSNull.NULL); }
/** * Adds an attribute object. * * @param attributeObject the attribute object */ public void addAttribute(PDAttributeObject attributeObject) { COSName key = COSName.A; attributeObject.setStructureElement(this); COSBase a = this.getCOSObject().getDictionaryObject(key); COSArray array; if (a instanceof COSArray) { array = (COSArray) a; } else { array = new COSArray(); if (a != null) { array.add(a); array.add(COSInteger.get(0)); } } this.getCOSObject().setItem(key, array); array.add(attributeObject); array.add(COSInteger.get(this.getRevisionNumber())); }
/** * Returns all encode values as COSArray. * * @return the encode array. */ private COSArray getEncodeValues() { if (encode == null) { encode = (COSArray) getCOSObject().getDictionaryObject(COSName.ENCODE); // the default value is [0 (size[0]-1) 0 (size[1]-1) ...] if (encode == null) { encode = new COSArray(); COSArray sizeValues = getSize(); int sizeValuesSize = sizeValues.size(); for (int i = 0; i < sizeValuesSize; i++) { encode.add(COSInteger.ZERO); encode.add(COSInteger.get(sizeValues.getInt(i) - 1)); } } } return encode; }