There is a technique that can be used to ensure that your app, that is emailing the PDF, waits until the document is in a steady state before it sends the pdf to the emailer for attachment.  There is an example of this technique in this document bpi.readpath()