iText 7 7.1.8 API
iText.IO.Image.ImageDataFactory Class Reference

Static Public Member Functions

static ImageData  Create (byte[] bytes, bool recoverImage)
  Create an ImageData instance representing the image from the image bytes. More...
 
static ImageData  Create (byte[] bytes)
  Create an ImageData instance representing the image from the image bytes. More...
 
static ImageData  Create (Uri url, bool recoverImage)
  Create an ImageData instance representing the image from the file located at the specified url. More...
 
static ImageData  Create (Uri url)
  Create an ImageData instance representing the image from the file located at the specified url. More...
 
static ImageData  Create (String filename, bool recoverImage)
  Create an ImageData instance representing the image from the specified file. More...
 
static ImageData  Create (String filename)
  Create an ImageData instance representing the image from the specified file. More...
 
static ImageData  Create (int width, int height, bool reverseBits, int typeCCITT, int parameters, byte[] data, int[] transparency)
  Create an ImageData instance from the passed parameters. More...
 
static ImageData  Create (int width, int height, int components, int bpc, byte[] data, int[] transparency)
  Create an ImageData instance from the passed parameters. More...
 
static ImageData  Create (System.Drawing.Image image, Color? color)
  Gets an instance of an Image from a java.awt.Image More...
 
static ImageData  Create (System.Drawing.Image image, Color? color, bool forceBW)
  Gets an instance of an Image from a java.awt.Image. More...
 
static ImageData  CreateBmp (Uri url, bool noHeader, int size)
  Get a bitmap ImageData instance from the specified url. More...
 
static ImageData  CreateBmp (byte[] bytes, bool noHeader, int size)
  Get a bitmap ImageData instance from the provided bytes. More...
 
static GifImageData  CreateGif (byte[] bytes)
  Return a GifImage object. More...
 
static ImageData  CreateGifFrame (Uri url, int frame)
  Returns a specified frame of the gif image More...
 
static ImageData  CreateGifFrame (byte[] bytes, int frame)
  Returns a specified frame of the gif image More...
 
static IList< ImageData CreateGifFrames (byte[] bytes, int[] frameNumbers)
  Returns More...
 
static IList< ImageData CreateGifFrames (Uri url, int[] frameNumbers)
  Returns More...
 
static IList< ImageData CreateGifFrames (byte[] bytes)
  Returns More...
 
static IList< ImageData CreateGifFrames (Uri url)
  Returns More...
 
static ImageData  CreateJbig2 (Uri url, int page)
 
static ImageData  CreateJbig2 (byte[] bytes, int page)
 
static ImageData  CreateJpeg (Uri url)
  Create a ImageData instance from a Jpeg image url More...
 
static ImageData  CreateJpeg (byte[] bytes)
 
static ImageData  CreateJpeg2000 (Uri url)
 
static ImageData  CreateJpeg2000 (byte[] bytes)
 
static ImageData  CreatePng (Uri url)
 
static ImageData  CreatePng (byte[] bytes)
 
static ImageData  CreateTiff (Uri url, bool recoverFromImageError, int page, bool direct)
 
static ImageData  CreateTiff (byte[] bytes, bool recoverFromImageError, int page, bool direct)
 
static ImageData  CreateRawImage (byte[] bytes)
 
static bool  IsSupportedType (byte[] source)
  Checks if the type of image (based on first 8 bytes) is supported by factory.

Note:if this method returns More...
 
static bool  IsSupportedType (Uri source)
  Checks if the type of image (based on first 8 bytes) is supported by factory.

Note:if this method returns More...
 

Member Function Documentation

◆ Create() [1/10]

static ImageData iText.IO.Image.ImageDataFactory.Create ( byte[]  bytes )
inlinestatic

Create an ImageData instance representing the image from the image bytes.

Parameters
bytes byte representation of the image.
Returns
The created ImageData object.

◆ Create() [2/10]

static ImageData iText.IO.Image.ImageDataFactory.Create ( byte[]  bytes,
bool  recoverImage 
)
inlinestatic

Create an ImageData instance representing the image from the image bytes.

Parameters
bytes byte representation of the image.
recoverImage whether to recover from a image error (for TIFF-images)
Returns
The created ImageData object.

◆ Create() [3/10]

static ImageData iText.IO.Image.ImageDataFactory.Create ( int  width,
int  height,
bool  reverseBits,
int  typeCCITT,
int  parameters,
byte[]  data,
int[]  transparency 
)
inlinestatic

Create an ImageData instance from the passed parameters.

Parameters
width width of the image in pixels
height height of the image in pixels
reverseBits whether to reverse the bits stored in data (TIFF images).
typeCCITT Type of CCITT encoding
parameters colour space parameters
data array containing raw image data
transparency array containing transparency information
Returns
created ImageData object.

◆ Create() [4/10]

static ImageData iText.IO.Image.ImageDataFactory.Create ( int  width,
int  height,
int  components,
int  bpc,
byte[]  data,
int[]  transparency 
)
inlinestatic

Create an ImageData instance from the passed parameters.

Parameters
width width of the image in pixels
height height of the image in pixels
components colour space components
bpc bits per colour.
data array containing raw image data
transparency array containing transparency information
Returns
created ImageData object.

◆ Create() [5/10]

static ImageData iText.IO.Image.ImageDataFactory.Create ( String  filename )
inlinestatic

Create an ImageData instance representing the image from the specified file.

Parameters
filename filename of the file containing the image
Returns
The created ImageData object.
Exceptions
Java.Net.MalformedURLException

◆ Create() [6/10]

static ImageData iText.IO.Image.ImageDataFactory.Create ( String  filename,
bool  recoverImage 
)
inlinestatic

Create an ImageData instance representing the image from the specified file.

Parameters
filename filename of the file containing the image
recoverImage whether to recover from a image error (for TIFF-images)
Returns
The created ImageData object.
Exceptions
Java.Net.MalformedURLException

◆ Create() [7/10]

static ImageData iText.IO.Image.ImageDataFactory.Create ( System.Drawing.Image  image,
Color?  color 
)
inlinestatic

Gets an instance of an Image from a java.awt.Image

Parameters
image the java.awt.Image to convert
color if different from
null the transparency pixels are replaced by this color
RawImage
"System.IO.IOException"/>

◆ Create() [8/10]

static ImageData iText.IO.Image.ImageDataFactory.Create ( System.Drawing.Image  image,
Color?  color,
bool  forceBW 
)
inlinestatic

Gets an instance of an Image from a java.awt.Image.

Parameters
image the
java.awt.Image to convert
"color">if different from null the transparency pixels are replaced by this color
"forceBW">if true the image is treated as black and white
RawImage
"System.IO.IOException"/>

◆ Create() [9/10]

static ImageData iText.IO.Image.ImageDataFactory.Create ( Uri  url )
inlinestatic

Create an ImageData instance representing the image from the file located at the specified url.

Parameters
url location of the image
Returns
The created ImageData object.

◆ Create() [10/10]

static ImageData iText.IO.Image.ImageDataFactory.Create ( Uri  url,
bool  recoverImage 
)
inlinestatic

Create an ImageData instance representing the image from the file located at the specified url.

Parameters
url location of the image
recoverImage whether to recover from a image error (for TIFF-images)
Returns
The created ImageData object.

◆ CreateBmp() [1/2]

static ImageData iText.IO.Image.ImageDataFactory.CreateBmp ( byte[]  bytes,
bool  noHeader,
int  size 
)
inlinestatic

Get a bitmap ImageData instance from the provided bytes.

Parameters
bytes array containing the raw image data
noHeader Whether the image contains a header.
size size of the image
Returns
created ImageData.

◆ CreateBmp() [2/2]

static ImageData iText.IO.Image.ImageDataFactory.CreateBmp ( Uri  url,
bool  noHeader,
int  size 
)
inlinestatic

Get a bitmap ImageData instance from the specified url.

Parameters
url location of the image.
noHeader Whether the image contains a header.
size size of the image
Returns
created ImageData.

◆ CreateGif()

static GifImageData iText.IO.Image.ImageDataFactory.CreateGif ( byte[]  bytes )
inlinestatic

Return a GifImage object.

Return a GifImage object. This object cannot be added to a document

Parameters
bytes array containing the raw image data
Returns
GifImageData instance.

◆ CreateGifFrame() [1/2]

static ImageData iText.IO.Image.ImageDataFactory.CreateGifFrame ( byte[]  bytes,
int  frame 
)
inlinestatic

Returns a specified frame of the gif image

Parameters
bytes byte array of gif image
frame number of frame to be returned
Returns
GifImageData instance.

◆ CreateGifFrame() [2/2]

static ImageData iText.IO.Image.ImageDataFactory.CreateGifFrame ( Uri  url,
int  frame 
)
inlinestatic

Returns a specified frame of the gif image

Parameters
url url of gif image
frame number of frame to be returned
Returns
GifImageData instance.

◆ CreateGifFrames() [1/4]

static IList<ImageData> iText.IO.Image.ImageDataFactory.CreateGifFrames ( byte[]  bytes )
inlinestatic

Returns

List of gif image frames

Parameters
bytes byte array of gif image
Returns
all frames of gif image

◆ CreateGifFrames() [2/4]

static IList<ImageData> iText.IO.Image.ImageDataFactory.CreateGifFrames ( byte[]  bytes,
int[]  frameNumbers 
)
inlinestatic

Returns

List of gif image frames

Parameters
bytes byte array of gif image
frameNumbers array of frame numbers of gif image
Returns
All frames of gif image.

◆ CreateGifFrames() [3/4]

static IList<ImageData> iText.IO.Image.ImageDataFactory.CreateGifFrames ( Uri  url )
inlinestatic

Returns

List of gif image frames

Parameters
url url of gif image
Returns
all frames of gif image

◆ CreateGifFrames() [4/4]

static IList<ImageData> iText.IO.Image.ImageDataFactory.CreateGifFrames ( Uri  url,
int[]  frameNumbers 
)
inlinestatic

Returns

List of gif image frames

Parameters
url url of gif image
frameNumbers array of frame numbers of gif image
Returns
All frames of gif image.

◆ CreateJpeg()

static ImageData iText.IO.Image.ImageDataFactory.CreateJpeg ( Uri  url )
inlinestatic

Create a ImageData instance from a Jpeg image url

Parameters
url
Returns

◆ IsSupportedType() [1/2]

static bool iText.IO.Image.ImageDataFactory.IsSupportedType ( byte[]  source )
inlinestatic

Checks if the type of image (based on first 8 bytes) is supported by factory.

Note:if this method returns

true it doesn't means that Create(byte[]) won't throw exception

Parameters
source image raw bytes
Returns
true
if first eight bytes are recognised by factory as valid image type and
false
otherwise

◆ IsSupportedType() [2/2]

static bool iText.IO.Image.ImageDataFactory.IsSupportedType ( Uri  source )
inlinestatic

Checks if the type of image (based on first 8 bytes) is supported by factory.

Note:if this method returns

true it doesn't means that Create(byte[]) won't throw exception

Parameters
source image raw bytes
Returns
true
if first eight bytes are recognised by factory as valid image type and
false
otherwise