Interface IPdfImage
An image in a PDF document, may be an InlineImage or a PostScript image XObject (XObjectImage).
public interface IPdfImage
Properties
BitsPerComponent
The number of bits used to represent each color component.
int BitsPerComponent { get; }
Property Value
Bounds
The placement rectangle of the image in PDF coordinates.
PdfRectangle Bounds { get; }
Property Value
ColorSpaceDetails
The ColorSpaceDetails used to interpret the image.
This is not defined where IsImageMask is true and is optional where the image is JPXEncoded for XObjectImage.
ColorSpaceDetails ColorSpaceDetails { get; }
Property Value
Decode
Describes how to map image samples into the values appropriate for the ColorSpace. The image data is initially composed of values in the range 0 to 2^n - 1 where n is BitsPerComponent. The decode array contains a pair of numbers for each component in the ColorSpace. The value from the image data is then interpolated into the values relevant to the ColorSpace using the corresponding values of the decode array.
IReadOnlyList<decimal> Decode { get; }
Property Value
HeightInSamples
The height of the image in samples.
int HeightInSamples { get; }
Property Value
ImageDictionary
The full dictionary for this image object.
DictionaryToken ImageDictionary { get; }
Property Value
Interpolate
Specifies whether interpolation is to be performed. Interpolation smooths images where a single component in the image as defined may correspond to many pixels on the output device. The interpolation algorithm is implementation dependent and is not defined by the specification.
bool Interpolate { get; }
Property Value
IsImageMask
Indicates whether the image is to be treated as an image mask. If true the image is a monochrome image in which each sample is specified by a single bit (BitsPerComponent is 1). The image represents a stencil where sample values represent places on the page that should be marked with the current color or masked (not marked).
bool IsImageMask { get; }
Property Value
IsInlineImage
Whether this image is an InlineImage or a XObjectImage.
bool IsInlineImage { get; }
Property Value
RawBytes
The encoded bytes of the image with all filters still applied.
IReadOnlyList<byte> RawBytes { get; }
Property Value
RenderingIntent
The color rendering intent to be used when rendering the image.
RenderingIntent RenderingIntent { get; }
Property Value
WidthInSamples
The width of the image in samples.
int WidthInSamples { get; }
Property Value
Methods
TryGetBytes(out IReadOnlyList<byte>)
Get the decoded bytes of the image if applicable. For JPEG images and some other types the RawBytes should be used directly.
bool TryGetBytes(out IReadOnlyList<byte> bytes)
Parameters
bytes
IReadOnlyList<byte>
Returns
TryGetPng(out byte[])
Try to convert the image to PNG. Doesn't support conversion of JPG to PNG.
bool TryGetPng(out byte[] bytes)
Parameters
bytes
byte[]