Bug 7952 - PDF::Reuse under plack writes to console STDOUT instead to browser
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 12 Apr 2012 22:20:00 +0000 (00:20 +0200)
committerPaul Poulain <paul.poulain@biblibre.com>
Mon, 11 Jun 2012 16:21:57 +0000 (18:21 +0200)
commitdc1ccb1d74fede81a0603193bc27b43fbaf51298
tree4060761efcf9f4824b43db6911212224ea91acf1
parent91bf568114b3181f340d29e6491ea0008ae9694f
Bug 7952 - PDF::Reuse under plack writes to console STDOUT instead to browser

Without name option to prFile, PDF::Reuse opens '-' file which is real
console STDOUT on plack so pdf file gets emited to terminal instead of
sending it to browser.

This change creates temporary file using File::Temp, pass it to PDF::Reuse
and then reads it back and prints it out for plack (or CGI) to pick up.

Test secenario:

1. Home › Tools › Patron Card Creator › Manage Card Batches
2. select batch checkbox and click Export
3. select template and click Export
4. click on pdf file to download it

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
C4/Creators/PDF.pm