Represents an image XObject of a PDF document.
See: PDF1.7 s8.8
Returns the source path that was used when creating the image object.
This value is only set when the image object was created by using the image loading facility and not when the image is part of a loaded PDF file.
Public Instance Methods
Returns the height of the image.
Returns an Info structure with information about the image.
The type of the image. Either :jpeg, :jp2, :jbig2, :ccitt or :png.
The width of the image.
The height of the image.
The color space the image uses. Either :rgb, :cmyk, :gray or :other.
Whether the image uses an indexed color space or not.
The number of color components of the color space, or -1 if the number couldn't be determined.
The number of bits per color component.
Whether the image can be written by HexaPDF.
The file extension that would be used when writing the file. Either jpg, jpx or png. Only meaningful when writable is true.
Returns the width of the image.
Saves this image XObject to the file with the given name and appends the correct extension (if the name already contains this extension, the name is used as is), or the given IO object.
Raises an error if the image format is not supported.
The output format and extension depends on the image type as returned by the info method:
Saved as a JPEG file with the extension '.jpg'
Saved as a JPEG2000 file with the extension '.jpx'
Saved as a PNG file with the extension '.png'