Good morning,
Hi Rendu,
I have attached the file again. It seems to only throw the exception when saving to a memory stream. If I save to a file it works fine.
Hi Rendu,
I have attached the entire solution as a .zip.
Hi Rendu,
.....
.....
//Global.log.Debug("[ConvertImagesToPdf] - Saving created Pdf document to memory stream");
MemoryStream ms = new MemoryStream();
byte[] outputDocument = null;
doc.Save(ms);
doc = new Document(ms);
// Optimzie the file size by removing unused objects
doc.Optimize();
doc.OptimizeResources(new Document.OptimizationOptions()
{
AllowReusePageContent = true,
LinkDuplcateStreams = true,
RemoveUnusedObjects = true,
RemoveUnusedStreams = true,
CompressImages = true,
ImageQuality = 80
});
ms = new MemoryStream();
doc.Save(ms);
outputDocument = ms.ToArray();
.....
.....
We are sorry for the inconvenience caused.
Best Regards,