Using pisa.CreatePDF does not close or flush the pisaContext document. As such, you cannot manipulate or move the PDF until the requesting method has finished because the last chunk is not written to the final PDF file. In my tests, the tmp file is a valid PDF document; however the generated PDF does not have the final chunk of info until the calling method ends.
Adding
c.dest.flush() or c.dest.close() to the pisaDocument method before returning the pisaContext instance resolves this issue.
Using pisa.CreatePDF does not close or flush the pisaContext document. As such, you cannot manipulate or move the PDF until the requesting method has finished because the last chunk is not written to the final PDF file. In my tests, the tmp file is a valid PDF document; however the generated PDF does not have the final chunk of info until the calling method ends.
Adding
c.dest.flush() or c.dest.close() to the pisaDocument method before returning the pisaContext instance resolves this issue.