Isn't doCreatePDFFile get called twice?  Once here and one down below (line 162) ?