XImageCollection

XImageCollection

Overview

XImageCollection is a class in Aspose.Pdf FOSS for Java. Inherits from: Iterable<XImage>.

Collection of image XObjects from a page’s /XObject resource dictionary.

Properties

NameTypeAccessDescription
countintReadReturns the number of images.
namesString[]ReadReturns an array of all image resource names in this collection.

Methods

SignatureDescription
XImageCollection(resourcesDict: COSDictionary, xobjectDict: COSDictionary, parser: PDFParser)Creates an XImageCollection from an /XObject dictionary.
XImageCollection(xobjectDict: COSDictionary, parser: PDFParser)Creates an XImageCollection from an /XObject dictionary.
get(index: int)XImageReturns the image at the given 1-based index.
get(name: String)XImageReturns the image by resource name (e.g., “Im1”).
getCount()intReturns the number of images.
size()intReturns the number of images (alias for {@link #getCount()}).
getNames()String[]Returns an array of all image resource names in this collection.
iterator()Iterator<XImage>
add(imageStream: InputStream)Adds an image from an input stream to this collection.
delete(index: int)Deletes the image at the given 1-based index from the parent /XObject dictionary.
delete(name: String)Deletes the image with the given resource name.
replace(index: int, newImageStream: InputStream)Replaces the image at the given 1-based index with a new image.
replace(name: String, newImageStream: InputStream)Replaces the image with the given resource name with a new image.

See Also