You need to return something to work with when using MemoryStream. The best way to do this is to return an array. This way you get the byte[]
using (MemoryStream ms = new MemoryStream())
{
Document document = new Document(PageSize.A4, 25, 25, 30, 30);
PdfWriter writer = PdfWriter.GetInstance(document, ms);
document.Open();
document.Add(new Paragraph("hej"));
document.Close();
writer.Close();
return ms.ToArray();
}
PS I did not mean to sound like you did not know the difference