TiffBitmapDecoder decoder = new TiffBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
using (MemoryStream allFra
After writing to ms
, the position of ms
is at its end. You have to seek to the beginning of the stream, e.g. with:
ms.Seek(0,System.IO.SeekOrigin.Begin);
After that ms.CopyTo
is working correctly.
Reset Position
of ms
to 0 after you fill it:
enc.Save(ms);
ms.Position = 0;
ms.CopyTo(allFrameStream);
From Stream.CopyTo
Copying begins at the current position in the current stream
Try executing allFrameStream.Position = 0;
just before writing to the PDF.