Table of Contents

Method SaveAsMultipageTiffBytes

Namespace
LMKit.Media.Image
Assembly
LM-Kit.NET.dll

SaveAsMultipageTiffBytes(params ImageBuffer[])

Encodes multiple images as pages of a single multipage TIFF to a byte array, without writing to disk - the in-memory twin of SaveAsMultipageTiff(string, params ImageBuffer[]). Pages are appended in order through the native streaming TIFF writer, so only bookkeeping - never a second copy of the pixel data - accumulates while encoding.

public static byte[] SaveAsMultipageTiffBytes(params ImageBuffer[] pages)

Parameters

pages ImageBuffer[]

The images to include as pages, in order.

Returns

byte[]

A byte array containing the multipage TIFF-encoded data.

Exceptions

ArgumentNullException

Thrown if pages or one of its entries is null.

ArgumentException

Thrown if pages is empty.

InvalidOperationException

Thrown if encoding fails.

SaveAsMultipageTiffBytes(ImageEncoderOptions, params ImageBuffer[])

Encodes several images as the pages of ONE multipage TIFF, every page written with options (codec, metadata policy, colour target - a CMYK press file with every page in four inks is one call). The pages may differ in size and pixel format; one decoded page at a time is handed to the writer.

public static byte[] SaveAsMultipageTiffBytes(ImageBuffer.ImageEncoderOptions options, params ImageBuffer[] pages)

Parameters

options ImageBuffer.ImageEncoderOptions

The page-level encoder settings; null for the defaults.

pages ImageBuffer[]

The pages, in order. At least one.

Returns

byte[]

The TIFF file bytes.

Examples

byte[] press = ImageBuffer.SaveAsMultipageTiffBytes(
    new ImageBuffer.ImageEncoderOptions { TiffCompression = TiffCompression.Deflate, ColorTarget = ImageColorTarget.Cmyk },
    page1, page2, page3);

Exceptions

ArgumentNullException

pages or one of its entries is null.

ArgumentException

No page was given.

InvalidOperationException

A page could not be encoded.

Share