public void addObject(COSObject obj) { if (obj != null && !obj.empty()) { this.addedObjects.add(obj); } }
public InfoDictionaryImpl(COSObject info, COSDocument doc) { if (info == null || info.empty() || doc == null) { throw new IllegalArgumentException("Info dictionary representation can not be null"); } this.info = info; this.doc = doc; }
@Override public void execute(Stack<COSObject> operandStack, Map<ASAtom, COSObject> userDict) throws PostScriptException { if (!object.empty()) { operandStack.push(this.object); } } }
public boolean setKey(final ASAtom key, final COSObject value) { if (value.empty()) { this.entries.remove(key); } else { this.entries.put(key, value); } return true; }
public void addChangedObject(COSObject obj) { if (obj != null && !obj.empty() && !isObjectChanged(obj)) { this.changedObjects.add(obj); } }
/** * Checks if char proc dictionary contains char proc for glyph with given * code. * * @param code is the code of glyph. * @return true if char proc for this glyph is present. */ public boolean containsCharString(int code) { return !getCharProc(code).empty(); }
private COSObject getAttribute(ASAtom attributeName, COSObjType expectedType) { if (this.propertiesDict != null) { COSObject res = this.propertiesDict.getKey(attributeName); if (res != null && !res.empty() && res.getType() == expectedType) { return res; } } return null; }
private void parseUseCMap() { if (this.useCMap == null) { COSObject useCMap = getUseCMap(); if (!useCMap.empty()) { this.useCMap = new PDCMap(useCMap); } } }
public boolean getImageMask() { COSObject im = getKey(ASAtom.IM); if (im.empty()) { im = getKey(ASAtom.IMAGE_MASK); } Boolean result = im.getBoolean(); return result != null ? result.booleanValue() : false; }
private static void addObjectWithTypeKeyCheck(List<COSObject> objects, COSObject obj, ASAtom type) { if (obj != null && !obj.empty() && obj.getType().isDictionaryBased()) { ASAtom actualType = obj.getNameKey(ASAtom.TYPE); if (actualType == type) { objects.add(obj); } } }
public PDColorSpace getColorSpace() { COSObject obj = getObject().getKey(ASAtom.COLORSPACE); if (obj != null && !obj.empty()) { return ColorSpaceFactory.getColorSpace(obj, this.resources, false); } LOGGER.log(Level.FINE,"Shading object do not contain required key ColorSpace"); return null; }
/** * @return The size of the Widths array; null if the Widths array is not * present or has invalid type. */ @Override public Long getWidths_size() { COSObject widths = this.pdFont.getWidths(); if (widths.empty() || widths.getType() != COSObjType.COS_ARRAY) { return null; } return Long.valueOf((widths.getDirectBase()).size().longValue()); }
public PDOptionalContentProperties getOCProperties() { COSObject object = getKey(ASAtom.OCPROPERTIES); if (object != null && !object.empty() && object.getType() == COSObjType.COS_DICT) { return new PDOptionalContentProperties(object); } return null; }
protected COSObject getInheritableResources() { COSObject value = getObject().getKey(ASAtom.RESOURCES); if (value != null && !value.empty()) { return value; } if (parent != null) { return parent.getInheritableResources(); } return null; }
@Override public Double getca() { COSObject ca = ((org.verapdf.pd.PDExtGState) simplePDObject).getCA_NS(); if (ca.getType().isNumber()) { return ca.getReal(); } else if (ca.empty()) { return null; } else { LOGGER.log(Level.SEVERE, "Value of ca key is not a number. Ignoring ca"); return 2.0; // check is failed } }
private static boolean checkProperty(COSObject info, Map<ASAtom, Object> properties, ASAtom checksRule) { final COSObject item = info.getKey(checksRule); if (item == null || item.empty() || item.getType() == COSObjType.COS_NULL) { return true; } else if (item.getType() == COSObjType.COS_STRING) { return checkCOSStringProperty(item, properties, checksRule).booleanValue(); } return false; }
public PageLabels getPageLabels() { COSObject labelsTree = getKey(ASAtom.PAGE_LABELS); if (labelsTree != null && !labelsTree.empty() && labelsTree.getType() == COSObjType.COS_DICT) { return new PageLabels((COSDictionary) labelsTree.getDirectBase()); } return null; }
private COSObject getEmbeddedFile() { if (embFile != null && !embFile.empty()){ COSObject efDict = embFile.getKey(ASAtom.EF); if (efDict != null && efDict.getType() == COSObjType.COS_DICT) { COSObject file = efDict.getKey(ASAtom.F); if (file != null && file.getType() == COSObjType.COS_STREAM) { return file; } } } return null; }
public GFPDObject(org.verapdf.pd.PDObject simplePDObject, final String type) { super(type); this.simplePDObject = simplePDObject; if (simplePDObject != null && !simplePDObject.getObject().empty()) { this.simpleCOSObject = simplePDObject.getObject(); COSKey key = simplePDObject.getObject().getObjectKey(); id = key != null ? key.getNumber() + " " + key.getGeneration() + " obj " + this.getObjectType() : super.getID(); } }