CreateImage(ReadOnlySpan, PdfImageLayout, PdfImageCompression) Method

Definition

Namespace Broadside
Assembly Broadside.dll

Creates an image XObject from a buffer of samples, or returns the one this document already has for the same samples.

public PdfImage CreateImage(ReadOnlySpan<byte> samples, PdfImageLayout layout, PdfImageCompression compression)

Parameters

samples
ReadOnlySpan<Byte>

The samples, in the layout layout describes: exactly ceil(Width × components × BitsPerComponent / 8) × Height bytes.

layout
PdfImageLayout

The size, colour space and bits per component.

compression
PdfImageCompression

How to compress the samples.

Returns

PdfImage
The image, an indirect stream.

Remarks

ISO 32000-2 §8.9.5 (Table 87), §7.4.4 (FlateDecode with Predictor 15, Table 8) or §7.4.8 (DCTDecode, through the document's DCT encoder). Records the versions of the compression, the colour space and 16-bit samples (PDF 1.5). A mutation.