This is a reply to the posting by "Filth" about empty PDF - "rocksky" has more or less the same solution.
The trick is here:
stamp.FormFlattening = true;
// very important to keep the MemoryStream intact
It took me a good deal of head-scratching to find the solution a while back, and I've posted a blog-posting about it on my (infrequently updated) blog: