iTextSharp - Create new document as Byte[]
问题 Have a little method which goes to the database and retrieves a pdf document from a varbinary column and then adds data to it. I would like to add code so that if this document (company stationery ) is not found then a new blank document is created and returned. The method could either return a Byte[] or a Stream. Problem is that the variable "bytes" in the else clause is null. Any ideas what's wrong? private Byte[] GetBasePDF(Int32 AttachmentID) { Byte[] bytes = null; DataTable dt =