Method SaveAsMultipageTiffBytes
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
pagesImageBuffer[]The images to include as pages, in order.
Returns
- byte[]
A byte array containing the multipage TIFF-encoded data.
Exceptions
- ArgumentNullException
Thrown if
pagesor one of its entries isnull.- ArgumentException
Thrown if
pagesis 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
optionsImageBuffer.ImageEncoderOptionsThe page-level encoder settings;
nullfor the defaults.pagesImageBuffer[]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
pagesor one of its entries is null.- ArgumentException
No page was given.
- InvalidOperationException
A page could not be encoded.