The reason the document was appearing blank when I converted the stream back to a PDF is that when using document.Save(memoryStream, false);
, it is neccessary to call document.Close();
after, i.e.:
document.Save(memoryStream, false);
document.Close();