Currently if I use Enumerator.outputStream it looks like it will never finish, but after stopping the request the data is downloaded correctly, so it looks like that:
val enumerator = Enumerator.outputStream { os =>
PDFGenerator.x(a, json, os)
}
val headers = Map((CONTENT_TYPE, "application/pdf"), (CONTENT_DISPOSITION, "inline; filename=" + filename + ".pdf"))
Result(
header = ResponseHeader(200, headers),
body = enumerator
)
won't work for me, somehow the PDFGenerator will still call os.close(), but it still won't stop at the eof