Buffer cannot be null

Buffer cannot be null

Forum member · Nov 6, 2020
We are using DynamicPDF For .NET (4.0) version 7.0.1.40 This code is throwing an exception. private MergeDocument CombineFiles(IPrint[] docs) { MergeDocument mergedDoc = new MergeDocument(); foreach (IPrint pdfPrinter in docs.Where(doc => doc.DocumentType == DocType.PDF | doc.DocumentType == DocType.DOCXasPDF)) mergedDoc.Append(new PdfDocument(pdfPrinter.Document)); return mergedDoc; } Exception occurred: Buffer cannot be null. Parameter name: buffer at System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable) Please advise.

Re: Buffer cannot be null

Support · Nov 6, 2020
Hi, What is the data type of pdfPrinter.Document? If it is a byte array, please ensure it does not have a value of null. Thanks, ceTe Software Support Team