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
| Name | Type | Access | Description |
|---|---|---|---|
count | int | Read | Returns the number of images. |
names | String[] | Read | Returns an array of all image resource names in this collection. |
Methods
| Signature | Description |
|---|---|
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) → XImage | Returns the image at the given 1-based index. |
get(name: String) → XImage | Returns the image by resource name (e.g., “Im1”). |
getCount() → int | Returns the number of images. |
size() → int | Returns 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. |