com.aspose.pdf

Interfaces

Classes

Enums

Exceptions

com.aspose.pdf

Class XImageCollection

    • Method Detail

      • size

        public int size()

        Count of images in collection.

        Returns:
        int value
      • isSynchronized

        public boolean isSynchronized()

        Returns true if object is synchronized.

        Returns:
        boolean value
      • getSyncRoot

        public Object getSyncRoot()

        Returns synchronization object.

        Returns:
        Object element
      • getNames

        public String[] getNames()

        Gets array of image names.

        Returns:
        String[] array
      • isReadOnly

        public boolean isReadOnly()

        Gets a value indicating whether the collection is read-only.

        Returns:
        boolean value
      • add

        public String add(XImage image)

        Adds new image to Image list. This method adds image as reference to the same PdfObject (which allows to decrease file size)

        Parameters:
        image - XImage to be added.
        Returns:
        Name of the added image.
      • add

        public String add(InputStream image)

        Adds entity to the end of the collection, so entity can be accessed by the last index.

        Parameters:
        image - Stream containing image data (in JPEG format).
        Returns:
        Name of the added image.
      • add

        public String add(BufferedImage image)

        Adds entity to the end of the collection, so entity can be accessed by the last index.

        Parameters:
        image - BufferedImage containing image data.
        Returns:
        Name of the added image.
      • addWithImageFilterType

        public String addWithImageFilterType(InputStream image,
                                             int filterType)

        Adds entity to the end of the collection, so entity can be accessed by the last index.

        Parameters:
        image - Stream containing image data.
        filterType - The image filter type.
        Returns:
        Name of the added image.
        See Also:
        ImageFilterType
      • add

        public String add(InputStream image,
                          int quality)

        Adds entity to the end of the collection, so entity can be accessed by the last index.

        Parameters:
        image - Stream containing image data (in JPEG format).
        quality - JPEG quality.
        Returns:
        Name of the added image.
      • delete

        public void delete(int index)

        Removes index from collection by index.

        Parameters:
        index - Image index.
      • delete

        public void delete(String name)

        Removes index from collection by name.

        Parameters:
        name - Name of image which must to be deleted.
      • delete

        public void delete()

        Deletes images from collection.

      • copyTo

        public void copyTo(XImage[] array,
                           int index)

        Copies array of images into collection.

        Parameters:
        array - Array to be copied.
        index - Index where images will be copied into collection.
      • replace

        public void replace(int index,
                            InputStream stream)

        Replace image in collection with another image.

        Parameters:
        index - Index of collection item which will be replaced.
        stream - Stream containing image data (in JPEG format).
      • replace

        public void replace(int index,
                            InputStream stream,
                            int quality)

        Replace image in collection with another image.

        Parameters:
        index - Index of collection item which will be replaced.
        stream - Stream containing image data (in JPEG format).
        quality - JPEG quality.
      • get_Item

        public XImage get_Item(int index)

        Gets image from collection by its index.

        Parameters:
        index - Image index
        Returns:
        Retreived image.
      • get_Item

        public XImage get_Item(String name)

        Gets image from collection by its name.

        Parameters:
        name - Image name.
        Returns:
        Retreived image.
      • hasImage

        public boolean hasImage(String imgName)
      • getImageName

        public String getImageName(XImage image)

        Returns name in images list which is key of the given image.

        Parameters:
        image - Image to search.
        Returns:
        Name (key) of the found image; null if images was not found.
      • clear

        public void clear()

        Clears all items from the collection.

      • contains

        public boolean contains(XImage item)

        Determines whether the collection contains a specific value.

        Parameters:
        item - The object to locate in the collection
        Returns:
        true if item is found in the collection; otherwise, false.
      • remove

        public boolean remove(XImage item)
        Not supported yet.

        Always throws NotImplementedException

        Parameters:
        item - XImage instance
        Returns:
        boolean value