/** * Returns true if the given color space name exists in these resources. * * @param name Name of the color space resource. */ public boolean hasColorSpace(COSName name) { return get(COSName.COLORSPACE, name) != null; }
COSDictionary dict = (COSDictionary)get(COSName.SHADING, name); if (dict != null)
/** * Returns the pattern resource with the given name, or null if none exists. * * @param name Name of the pattern resource. * @throws IOException if something went wrong. */ public PDAbstractPattern getPattern(COSName name) throws IOException { COSObject indirect = getIndirect(COSName.PATTERN, name); if (cache != null && indirect != null) { PDAbstractPattern cached = cache.getPattern(indirect); if (cached != null) { return cached; } } // get the instance PDAbstractPattern pattern = null; COSDictionary dict = (COSDictionary)get(COSName.PATTERN, name); if (dict != null) { pattern = PDAbstractPattern.create(dict); } if (cache != null) { cache.put(indirect, pattern); } return pattern; }
/** * Tells whether the XObject resource with the given name is an image. * * @param name Name of the XObject resource. * @return true if it is an image XObject, false if not. */ public boolean isImageXObject(COSName name) { // get the instance COSBase value = get(COSName.XOBJECT, name); if (value == null) { return false; } else if (value instanceof COSObject) { value = ((COSObject) value).getObject(); } if (!(value instanceof COSStream)) { return false; } COSStream stream = (COSStream) value; return COSName.IMAGE.equals(stream.getCOSName(COSName.SUBTYPE)); }
/** * Returns the property list resource with the given name, or null if none exists. * * @param name Name of the property list resource. */ public PDPropertyList getProperties(COSName name) { COSObject indirect = getIndirect(COSName.PROPERTIES, name); if (cache != null && indirect != null) { PDPropertyList cached = cache.getProperties(indirect); if (cached != null) { return cached; } } // get the instance PDPropertyList propertyList = null; COSDictionary dict = (COSDictionary)get(COSName.PROPERTIES, name); if (dict != null) { propertyList = PDPropertyList.create(dict); } if (cache != null) { cache.put(indirect, propertyList); } return propertyList; }
/** * Returns true if the given color space name exists in these resources. * * @param name Name of the color space resource. * * @return true if the color space with the given name exists. */ public boolean hasColorSpace(COSName name) { return get(COSName.COLORSPACE, name) != null; }
/** * Returns the extended graphics state resource with the given name, or null * if none exists. * * @param name Name of the graphics state resource. */ public PDExtendedGraphicsState getExtGState(COSName name) { COSObject indirect = getIndirect(COSName.EXT_G_STATE, name); if (cache != null && indirect != null) { PDExtendedGraphicsState cached = cache.getExtGState(indirect); if (cached != null) { return cached; } } // get the instance PDExtendedGraphicsState extGState = null; COSDictionary dict = (COSDictionary)get(COSName.EXT_G_STATE, name); if (dict != null) { extGState = new PDExtendedGraphicsState(dict); } if (cache != null) { cache.put(indirect, extGState); } return extGState; }
/** * Returns true if the given color space name exists in these resources. * * @param name Name of the color space resource. */ public boolean hasColorSpace(COSName name) { return get(COSName.COLORSPACE, name) != null; }
COSDictionary dict = (COSDictionary)get(COSName.FONT, name); if (dict != null)
/** * Tells whether the XObject resource with the given name is an image. * * @param name Name of the XObject resource. * @return true if it is an image XObject, false if not. */ public boolean isImageXObject(COSName name) { // get the instance COSBase value = get(COSName.XOBJECT, name); if (value == null) { return false; } else if (value instanceof COSObject) { value = ((COSObject) value).getObject(); } if (!(value instanceof COSStream)) { return false; } COSStream stream = (COSStream) value; return COSName.IMAGE.equals(stream.getCOSName(COSName.SUBTYPE)); }
COSBase object = get(COSName.COLORSPACE, name); if (object != null)
/** * Tells whether the XObject resource with the given name is an image. * * @param name Name of the XObject resource. * @return true if it is an image XObject, false if not. */ public boolean isImageXObject(COSName name) { // get the instance COSBase value = get(COSName.XOBJECT, name); if (value == null) { return false; } else if (value instanceof COSObject) { value = ((COSObject) value).getObject(); } if (!(value instanceof COSStream)) { return false; } COSStream stream = (COSStream) value; return COSName.IMAGE.equals(stream.getCOSName(COSName.SUBTYPE)); }
COSBase value = get(COSName.XOBJECT, name); if (value == null)
COSDictionary dict = (COSDictionary)get(COSName.PROPERTIES, name); if (dict != null)
/** * Returns the property list resource with the given name, or null if none exists. * * @param name Name of the property list resource. */ public PDPropertyList getProperties(COSName name) { COSObject indirect = getIndirect(COSName.PROPERTIES, name); if (cache != null && indirect != null) { PDPropertyList cached = cache.getProperties(indirect); if (cached != null) { return cached; } } // get the instance PDPropertyList propertyList = null; COSDictionary dict = (COSDictionary)get(COSName.PROPERTIES, name); if (dict != null) { propertyList = PDPropertyList.create(dict); } if (cache != null) { cache.put(indirect, propertyList); } return propertyList; }
/** * Returns the extended graphics state resource with the given name, or null * if none exists. * * @param name Name of the graphics state resource. */ public PDExtendedGraphicsState getExtGState(COSName name) { COSObject indirect = getIndirect(COSName.EXT_G_STATE, name); if (cache != null && indirect != null) { PDExtendedGraphicsState cached = cache.getExtGState(indirect); if (cached != null) { return cached; } } // get the instance PDExtendedGraphicsState extGState = null; COSDictionary dict = (COSDictionary)get(COSName.EXT_G_STATE, name); if (dict != null) { extGState = new PDExtendedGraphicsState(dict); } if (cache != null) { cache.put(indirect, extGState); } return extGState; }
COSDictionary dict = (COSDictionary)get(COSName.SHADING, name); if (dict != null)
/** * Returns the pattern resource with the given name, or null if none exists. * * @param name Name of the pattern resource. * @throws IOException if something went wrong. */ public PDAbstractPattern getPattern(COSName name) throws IOException { COSObject indirect = getIndirect(COSName.PATTERN, name); if (cache != null && indirect != null) { PDAbstractPattern cached = cache.getPattern(indirect); if (cached != null) { return cached; } } // get the instance PDAbstractPattern pattern = null; COSDictionary dict = (COSDictionary)get(COSName.PATTERN, name); if (dict != null) { pattern = PDAbstractPattern.create(dict); } if (cache != null) { cache.put(indirect, pattern); } return pattern; }
COSDictionary dict = (COSDictionary)get(COSName.SHADING, name); if (dict != null)
COSBase object = get(COSName.COLORSPACE, name); if (object != null)