com.aspose.pdf

Interfaces

Classes

Enums

Exceptions

com.aspose.pdf

Class XImageCollection

  • All Implemented Interfaces:
    com.aspose.ms.System.Collections.ICollection<XImage>, com.aspose.ms.System.Collections.IEnumerable<XImage>, Iterable<XImage>


    public final class XImageCollection
    extends Object
    implements com.aspose.ms.System.Collections.ICollection<XImage>

    Class representing XImage collection.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void add(BufferedImage image)
      Adds entity to the end of the collection, so entity can be accessed by the last index.
      String add(InputStream image)
      Adds entity to the end of the collection, so entity can be accessed by the last index.
      void add(InputStream image, int quality)
      Adds entity to the end of the collection, so entity can be accessed by the last index.
      String add(XImage image)
      Adds new image to Image list.
      void addWithImageFilterType(InputStream image, int filterType)
      Adds entity to the end of the collection, so entity can be accessed by the last index.
      void copyTo(com.aspose.ms.System.Array array, int index)
      Copies array of images into collection.
      void delete()
      Deletes images from collection.
      void delete(int index)
      Removes index from collection by index.
      void delete(String name)
      Removes index from collection by name.
      XImage get_Item(int index)
      Gets image from collection by its index.
      XImage get_Item(String name)
      Gets image from collection by its name.
      String getImageName(XImage image)
      Returns name in images list which is key of the given image.
      String[] getNames()
      Gets array of image names.
      Object getSyncRoot()
      Returns synchronization object.
      boolean hasImage(String imgName) 
      boolean isSynchronized()
      Returns true if object is synchronized.
      com.aspose.ms.System.Collections.IEnumerator iterator()
      Returns collection enumerator.
      void replace(int index, InputStream stream)
      Replace image in collection with another image.
      void replace(int index, InputStream stream, int quality)
      Replace image in collection with another image.
      int size()
      Count of images in collection.
    • Method Detail

      • size

        public int size()

        Count of images in collection.

        Specified by:
        size in interface com.aspose.ms.System.Collections.ICollection<XImage>
        Returns:
        int value
      • isSynchronized

        public boolean isSynchronized()

        Returns true if object is synchronized.

        Specified by:
        isSynchronized in interface com.aspose.ms.System.Collections.ICollection<XImage>
        Returns:
        boolean value
      • getSyncRoot

        public Object getSyncRoot()

        Returns synchronization object.

        Specified by:
        getSyncRoot in interface com.aspose.ms.System.Collections.ICollection<XImage>
        Returns:
        Object element
      • getNames

        public String[] getNames()

        Gets array of image names.

        Returns:
        String[] array
      • 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:
        String object
      • add

        public void 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.
      • addWithImageFilterType

        public void 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.
        See Also:
        ImageFilterType
      • add

        public void 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.
      • 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.

      • iterator

        public com.aspose.ms.System.Collections.IEnumerator iterator()

        Returns collection enumerator.

        Specified by:
        iterator in interface com.aspose.ms.System.Collections.IEnumerable<XImage>
        Specified by:
        iterator in interface Iterable<XImage>
        Returns:
        Enumerator of collection
      • copyTo

        public void copyTo(com.aspose.ms.System.Array array,
                  int index)

        Copies array of images into collection.

        Specified by:
        copyTo in interface com.aspose.ms.System.Collections.ICollection<XImage>
        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.