PdfImage Class

Definition

An image: an image XObject, an inline image, or the mask or alternate of one. A live view over the image dictionary that reads its entries with their defaults and decodes its samples on request.

public sealed class PdfImage

Remarks

ISO 32000-2 §8.9. Get one with GetImage(CosObject?), GetImage(String) or, for an inline image in a content stream, GetInlineImage(in ContentOperator). Every property reads the dictionary on every call. Deviations are repaired the way most readers repair them and recorded as diagnostics on the document (a property of an image that cannot be painted at all, such as one without a width, reads as 0 or null); in strict mode the first deviation throws from the member that meets it.

Decode() returns the samples in the §8.9.3 layout as a DecodedImage; the Decode array, colour conversion and masks are applied by the reader of the samples, with CreateDecodeMap(DecodedImage), ImageRows and GetColorConverter(PdfColorSpace). Masks are decoded at their own size (Mask), never resampled here. Nothing is cached; each Decode() decodes again.

Thread-safe for concurrent reads while the document is not mutated.

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Properties (22)

Methods (6)