xhtml2pdf icon indicating copy to clipboard operation
xhtml2pdf copied to clipboard

pisaDocument does not close or flush file

Open vjimw opened this issue 14 years ago • 0 comments

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.

vjimw avatar Apr 29 '11 18:04 vjimw