Fix the document adding code: there was a problem with not setting the transform for the text