Package com.datalogics.PDFL
Class ImageCollection
java.lang.Object
com.datalogics.PDFL.ImageCollection
An image collection can hold multiple images, created from an image file. The full set of images in the collection can be saved to a single image file, but only as a .tif image file. For any other file type (JPG, PNG, and so on), the collection can only be saved as one image object per file.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty image collection, which can have Image objects added to it.ImageCollection(Image image) Create a new image collection containing the supplied Image object.ImageCollection(String fileName) Create from an image file.ImageCollection(String fileName, Document document) Create from an image file.ImageCollection(ImageInputStream stream) Allows to create ImageCollection object from ImageInputStream. -
Method Summary
Modifier and TypeMethodDescriptionvoidInsert the given Image object at the end of the ImageCollection.voiddelete()intgetCount()getImage(int index) Retrieve the Image object at the specified index.voidSave the images in the collection to the specified file and image type.voidsave(String filename, ImageType type, ImageSaveParams saveparams) Save the images in the collection to the specified file and image type.
-
Constructor Details
-
ImageCollection
Allows to create ImageCollection object from ImageInputStream. The Stream must contain image data in the TIFF Format.- Throws:
IOException
-
ImageCollection
public ImageCollection()Create an empty image collection, which can have Image objects added to it. -
ImageCollection
Create from an image file. If the file is a TIFF, then an Image object will be created for each "page" of the TIFF. For all other types, only 1 Image object will be created.- Parameters:
fileName- The physical image file from which an image collection will be created.
-
ImageCollection
Create from an image file. If the file is a TIFF, then an Image object will be created for each "page" of the TIFF.For all other types, only 1 Image object will be created.
Specifying the document optimizes data usage for this image within that document.
- Parameters:
fileName- The physical image file from which an image collection will be created.document- the document in which the image is intended to be used.
-
ImageCollection
Create a new image collection containing the supplied Image object.- Parameters:
image- the Image object to be inserted upon creation.
-
-
Method Details
-
delete
public void delete() -
getCount
public int getCount()- Returns:
- the count of the number of members.
-
getImage
Retrieve the Image object at the specified index. Note that an exception will be generated if an index is given which is out of range.- Parameters:
index- the index of the Image to be retrieved.- Returns:
- the Image object at the specified index.
-
append
Insert the given Image object at the end of the ImageCollection.- Parameters:
image- the Image object to be inserted.
-
save
Save the images in the collection to the specified file and image type. Multiple images can only be save to an image type of TIFF, otherwise an exception will be thrown.- Parameters:
filename- the file which to save the image.type- the image type to which to be saved.
-
save
Save the images in the collection to the specified file and image type. Multiple images can only be save to an image type of TIFF, otherwise an exception will be thrown.- Parameters:
filename- the file which to save the image.type- the image type to which to be saved.saveparams- the ImageSaveParams parameters for customizing the image saving.
-